mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +00:00
dont push on silenced channels
This commit is contained in:
parent
06e19fe58c
commit
f51c9e791f
@ -75,8 +75,12 @@ func AddChannelTopic(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// determine affected contact list
|
// determine affected contact list
|
||||||
cards := make(map[string]store.Card)
|
cards := make(map[string]store.Card)
|
||||||
|
notify := make(map[string]store.Card)
|
||||||
for _, member := range channelSlot.Channel.Members {
|
for _, member := range channelSlot.Channel.Members {
|
||||||
cards[member.Card.GUID] = member.Card
|
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 _, group := range channelSlot.Channel.Groups {
|
||||||
for _, card := range group.Cards {
|
for _, card := range group.Cards {
|
||||||
@ -87,9 +91,9 @@ func AddChannelTopic(w http.ResponseWriter, r *http.Request) {
|
|||||||
SetStatus(act)
|
SetStatus(act)
|
||||||
for _, card := range cards {
|
for _, card := range cards {
|
||||||
SetContactChannelNotification(act, &card)
|
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))
|
WriteResponse(w, getTopicModel(topicSlot))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user