Merge pull request 'squash notifications on group messages while syncing' (#90) from squashSyncNotif into trunk

Reviewed-on: cwtch.im/libcwtch-go#90
Reviewed-by: Sarah Jamie Lewis <sarah@openprivacy.ca>
v1.8.0
Sarah Jamie Lewis 3 months ago
commit 7069fab0b1
  1. 9
      utils/eventHandler.go

@ -373,8 +373,15 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string {
if ci != nil && ci.Accepted {
handleImagePreviews(profile, &ev.Event, conversationID, ci.ID)
}
gci, _ := profile.GetConversationInfo(conversationID)
ev.Event.Data["notification"] = string(determineNotification(gci))
state := profile.GetPeerState(gci.Handle)
// if syncing, don't flood with notifications
if state == connections.SYNCED {
ev.Event.Data["notification"] = string(determineNotification(gci))
} else {
ev.Event.Data["notification"] = string(constants2.NotificationNone)
}
case event.PeerAcknowledgement:
ci, err := profile.FetchConversationInfo(ev.Event.Data["RemotePeer"])
if ci != nil && err == nil {

Loading…
Cancel
Save