squash notifications on group messages while syncing
continuous-integration/drone/pr Build is passing
Details
continuous-integration/drone/pr Build is passing
Details
This commit is contained in:
parent
231e27d116
commit
1efb0d076b
|
@ -373,8 +373,15 @@ func (eh *EventHandler) handleProfileEvent(ev *EventProfileEnvelope) string {
|
||||||
if ci != nil && ci.Accepted {
|
if ci != nil && ci.Accepted {
|
||||||
handleImagePreviews(profile, &ev.Event, conversationID, ci.ID)
|
handleImagePreviews(profile, &ev.Event, conversationID, ci.ID)
|
||||||
}
|
}
|
||||||
|
|
||||||
gci, _ := profile.GetConversationInfo(conversationID)
|
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:
|
case event.PeerAcknowledgement:
|
||||||
ci, err := profile.FetchConversationInfo(ev.Event.Data["RemotePeer"])
|
ci, err := profile.FetchConversationInfo(ev.Event.Data["RemotePeer"])
|
||||||
if ci != nil && err == nil {
|
if ci != nil && err == nil {
|
||||||
|
|
Reference in New Issue