mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-17 23:18:27 +02:00
Swiftify code, ignore session state
Signed-off-by: ismailgulek <gulekismail@gmail.com>
This commit is contained in:
@@ -161,25 +161,21 @@ class NotificationService: UNNotificationServiceExtension {
|
||||
if userAccount.mxSession == nil {
|
||||
userAccount.openSession(with: store)
|
||||
}
|
||||
let sessionState = userAccount.mxSession.state
|
||||
if sessionState == MXSessionStateInitialised || sessionState == MXSessionStatePaused {
|
||||
userAccount.initialBackgroundSync(20000, success: { [weak self] in
|
||||
guard let self = self else {
|
||||
NSLog("[NotificationService] Fallback case 12")
|
||||
return
|
||||
}
|
||||
self.fetchEvent()
|
||||
}) { [weak self] (error) in
|
||||
guard let self = self else {
|
||||
NSLog("[NotificationService] Fallback case 11")
|
||||
return
|
||||
}
|
||||
NSLog("[NotificationService] Fallback case 6")
|
||||
self.fallbackToOriginalContent()
|
||||
|
||||
// launch an initial background sync
|
||||
userAccount.initialBackgroundSync(20000, success: { [weak self] in
|
||||
guard let self = self else {
|
||||
NSLog("[NotificationService] Fallback case 12")
|
||||
return
|
||||
}
|
||||
} else {
|
||||
NSLog("[NotificationService] Fallback case 8")
|
||||
fallbackToOriginalContent()
|
||||
self.fetchEvent()
|
||||
}) { [weak self] (error) in
|
||||
guard let self = self else {
|
||||
NSLog("[NotificationService] Fallback case 11")
|
||||
return
|
||||
}
|
||||
NSLog("[NotificationService] Fallback case 6")
|
||||
self.fallbackToOriginalContent()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user