fix(@activity_center): filter contact request notification

fixes #6126
This commit is contained in:
Anthony Laibe 2022-06-21 10:43:55 +02:00 committed by Iuri Matias
parent 0cb3de69f3
commit ea1b53b34d
1 changed files with 4 additions and 3 deletions

View File

@ -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: