From f51c9e791fb2c3d0f5e994aa7ac7461339704018 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Tue, 15 Nov 2022 10:42:16 -0800 Subject: [PATCH] dont push on silenced channels --- net/server/internal/api_addChannelTopic.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/net/server/internal/api_addChannelTopic.go b/net/server/internal/api_addChannelTopic.go index d698a4a1..8078972f 100644 --- a/net/server/internal/api_addChannelTopic.go +++ b/net/server/internal/api_addChannelTopic.go @@ -75,8 +75,12 @@ func AddChannelTopic(w http.ResponseWriter, r *http.Request) { // determine affected contact list cards := make(map[string]store.Card) + notify := make(map[string]store.Card) for _, member := range channelSlot.Channel.Members { cards[member.Card.GUID] = member.Card + if member.PushEnabled && member.Card.GUID != guid { + notify[member.Card.GUID] = member.Card + } } for _, group := range channelSlot.Channel.Groups { for _, card := range group.Cards { @@ -87,9 +91,9 @@ func AddChannelTopic(w http.ResponseWriter, r *http.Request) { SetStatus(act) for _, card := range cards { SetContactChannelNotification(act, &card) - if card.GUID != guid { - SetContactPushNotification(&card, "content.addChannelTopic." + channelSlot.Channel.DataType) - } } + for _, card := range notify { + SetContactPushNotification(&card, "content.addChannelTopic." + channelSlot.Channel.DataType) + } WriteResponse(w, getTopicModel(topicSlot)) }