Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-ios
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-ios
Commits
22c94d14
Commit
22c94d14
authored
3 years ago
by
Kateryna Kostiuk
Committed by
Kateryna Kostiuk
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
presence: unsubscribe when app is in background
Change-Id: Ie15efebd03ea57e1ba9b7c33c406ac4e940a75ae
parent
99e288b9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Ring/Ring/AppDelegate.swift
+12
-5
12 additions, 5 deletions
Ring/Ring/AppDelegate.swift
with
12 additions
and
5 deletions
Ring/Ring/AppDelegate.swift
+
12
−
5
View file @
22c94d14
...
...
@@ -240,16 +240,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
}
func
reloadDataFor
(
account
:
AccountModel
)
{
self
.
contactsService
.
loadContacts
(
withAccount
:
account
)
self
.
contactsService
.
loadContactRequests
(
withAccount
:
account
.
id
)
self
.
presenceService
.
subscribeBuddies
(
withAccount
:
account
.
id
,
withContacts
:
self
.
contactsService
.
contacts
.
value
,
subscribe
:
true
)
self
.
conversationManager
?
.
prepareConversationsForAccount
(
accountId
:
account
.
id
)
let
state
=
UIApplication
.
shared
.
applicationState
if
state
==
.
active
{
self
.
contactsService
.
loadContacts
(
withAccount
:
account
)
self
.
contactsService
.
loadContactRequests
(
withAccount
:
account
.
id
)
self
.
presenceService
.
subscribeBuddies
(
withAccount
:
account
.
id
,
withContacts
:
self
.
contactsService
.
contacts
.
value
,
subscribe
:
true
)
self
.
conversationManager
?
.
prepareConversationsForAccount
(
accountId
:
account
.
id
)
}
}
func
applicationDidEnterBackground
(
_
application
:
UIApplication
)
{
self
.
log
.
warning
(
"entering background"
)
self
.
callService
.
muteCurrentCallVideoVideo
(
mute
:
true
)
guard
let
account
=
self
.
accountService
.
currentAccount
else
{
return
}
self
.
presenceService
.
subscribeBuddies
(
withAccount
:
account
.
id
,
withContacts
:
self
.
contactsService
.
contacts
.
value
,
subscribe
:
false
)
}
func
applicationWillEnterForeground
(
_
application
:
UIApplication
)
{
...
...
@@ -257,6 +262,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterD
self
.
daemonService
.
connectivityChanged
()
self
.
updateNotificationAvailability
()
self
.
callService
.
muteCurrentCallVideoVideo
(
mute
:
false
)
guard
let
account
=
self
.
accountService
.
currentAccount
else
{
return
}
self
.
presenceService
.
subscribeBuddies
(
withAccount
:
account
.
id
,
withContacts
:
self
.
contactsService
.
contacts
.
value
,
subscribe
:
true
)
}
func
applicationWillTerminate
(
_
application
:
UIApplication
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment