From ea1b53b34d77f54e6558f8a479aa0710c1e6d42b Mon Sep 17 00:00:00 2001 From: Anthony Laibe Date: Tue, 21 Jun 2022 10:43:55 +0200 Subject: [PATCH] fix(@activity_center): filter contact request notification fixes #6126 --- src/app_service/service/activity_center/service.nim | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app_service/service/activity_center/service.nim b/src/app_service/service/activity_center/service.nim index dea0187483..f9467eb0a8 100644 --- a/src/app_service/service/activity_center/service.nim +++ b/src/app_service/service/activity_center/service.nim @@ -1,4 +1,4 @@ -import NimQml, json, sequtils, chronicles, strutils, strutils, stint +import NimQml, json, sequtils, chronicles, strutils, strutils, stint, sugar import ../../../app/core/eventemitter import ../../../app/core/[main] @@ -86,7 +86,7 @@ QtObject: if (receivedData.activityCenterNotifications.len > 0): self.events.emit( SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED, - ActivityCenterNotificationsArgs(activityCenterNotifications: receivedData.activityCenterNotifications) + ActivityCenterNotificationsArgs(activityCenterNotifications: receivedData.activityCenterNotifications.filter(n => n.notificationType != ActivityCenterNotificationType.ContactRequest)) ) proc hasMoreToShow*(self: Service): bool = @@ -176,8 +176,9 @@ QtObject: self.cursor = activityCenterNotificationsTuple[0] + # Filter contact request notification til we have the UI working self.events.emit(SIGNAL_ACTIVITY_CENTER_NOTIFICATIONS_LOADED, - ActivityCenterNotificationsArgs(activityCenterNotifications: activityCenterNotificationsTuple[1])) + ActivityCenterNotificationsArgs(activityCenterNotifications: activityCenterNotificationsTuple[1].filter(n => n.notificationType != ActivityCenterNotificationType.ContactRequest))) proc acceptActivityCenterNotifications*(self: Service, notificationIds: seq[string]): string = try: