Disable Local Push Notifications + Start Handling invite notifications (#882)

* disabled local pushes and fixed the issue with the image rendering

* disabled local notifications for now and started implementing invite notificatons

* disabled local notifications for now and started implementing invite notificatons

* removed code that should not have changed

* removed useless comment

* refactored name for category

* fixed a test

* fix

* fix for missing try await

* pr comments
This commit is contained in:
Mauro
2023-05-12 12:45:59 +02:00
committed by GitHub
parent 185710adf4
commit 23137726de
9 changed files with 133 additions and 74 deletions
@@ -110,8 +110,10 @@ class ClientProxy: ClientProxyProtocol {
client.setDelegate(delegate: delegate)
// Set up sync listener for generating local notifications.
await Task.dispatch(on: clientQueue) {
client.setNotificationDelegate(notificationDelegate: delegate)
if ServiceLocator.shared.settings.enableLocalPushNotifications {
await Task.dispatch(on: clientQueue) {
client.setNotificationDelegate(notificationDelegate: delegate)
}
}
configureSlidingSync()
@@ -326,7 +328,9 @@ class ClientProxy: ClientProxyProtocol {
buildAndConfigureVisibleRoomsSlidingSyncList()
buildAndConfigureAllRoomsSlidingSyncList()
buildAndConfigureInvitesSlidingSyncList()
buildAndConfigureNotificationsSlidingSyncList()
if ServiceLocator.shared.settings.enableLocalPushNotifications {
buildAndConfigureNotificationsSlidingSyncList()
}
guard let visibleRoomsListBuilder else {
MXLog.error("Visible rooms sliding sync view unavailable")
@@ -537,11 +541,13 @@ class ClientProxy: ClientProxyProtocol {
MXLog.error("Invites sliding sync view unavailable")
}
if let notificationsListBuilder {
MXLog.info("Registering notifications view")
_ = slidingSync?.addList(listBuilder: notificationsListBuilder)
} else {
MXLog.error("Notifications sliding sync view unavailable")
if ServiceLocator.shared.settings.enableLocalPushNotifications {
if let notificationsListBuilder {
MXLog.info("Registering notifications view")
_ = slidingSync?.addList(listBuilder: notificationsListBuilder)
} else {
MXLog.error("Notifications sliding sync view unavailable")
}
}
}