Skip to content

Commit

Permalink
fix: do not pull notifications when app reinstalled. (#393)
Browse files Browse the repository at this point in the history
* fix: do not pull notifications when app reinstalled.

Signed-off-by: Gordon <[email protected]>

* fix: do not pull notifications when app reinstalled.

Signed-off-by: Gordon <[email protected]>

* fix: do not pull notifications when app reinstalled.

Signed-off-by: Gordon <[email protected]>

---------

Signed-off-by: Gordon <[email protected]>
  • Loading branch information
FGadvancer authored Oct 31, 2023
1 parent 359212b commit 06f0813
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/conversation_msg/conversation_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,9 @@ func (c *Conversation) addFaceURLAndName(ctx context.Context, lc *model_struct.L
}

func (c *Conversation) batchAddFaceURLAndName(ctx context.Context, conversations ...*model_struct.LocalConversation) error {
if len(conversations) == 0 {
return nil
}
var userIDs, groupIDs []string
for _, conversation := range conversations {
if conversation.ConversationType == constant.SingleChatType ||
Expand Down
5 changes: 5 additions & 0 deletions internal/interaction/msg_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ func (m *MsgSyncer) compareSeqsAndBatchSync(ctx context.Context, maxSeqToSync ma
if err != nil {
log.ZWarn(ctx, "SetNotificationSeq err", err, "conversationID", conversationID, "seq", seq)
continue
} else {
m.syncedMaxSeqs[conversationID] = seq
}
}
for conversationID, maxSeq := range messagesSeqMap {
Expand Down Expand Up @@ -245,6 +247,7 @@ func IsNotification(conversationID string) bool {
// Fragment synchronization message, seq refresh after successful trigger
func (m *MsgSyncer) syncAndTriggerMsgs(ctx context.Context, seqMap map[string][2]int64, syncMsgNum int64) error {
if len(seqMap) > 0 {
log.ZDebug(ctx, "current sync seqMap", "seqMap", seqMap)
tempSeqMap := make(map[string][2]int64, 50)
msgNum := 0
for k, v := range seqMap {
Expand Down Expand Up @@ -309,6 +312,8 @@ func (m *MsgSyncer) syncAndTriggerMsgs(ctx context.Context, seqMap map[string][2
for conversationID, seqs := range seqMap {
m.syncedMaxSeqs[conversationID] = seqs[1]
}
} else {
log.ZDebug(ctx, "noting conversation to sync", "syncMsgNum", syncMsgNum)
}
return nil
}
Expand Down

0 comments on commit 06f0813

Please sign in to comment.