Skip to content

Commit

Permalink
fix: remove null trigger conversation. (#350)
Browse files Browse the repository at this point in the history
* fix: unread bug fix when app reinstall.

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

* fix: remove null trigger conversation.

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>

---------

Signed-off-by: Gordon <46924906+FGadvancer@users.noreply.github.com>
  • Loading branch information
FGadvancer committed Sep 28, 2023
1 parent 3228436 commit 012a8c4
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions internal/interaction/msg_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,18 +326,25 @@ func (m *MsgSyncer) syncMsgBySeqs(ctx context.Context, conversationID string, se

// triggers a conversation with a new message.
func (m *MsgSyncer) triggerConversation(ctx context.Context, msgs map[string]*sdkws.PullMsgs) error {
err := common.TriggerCmdNewMsgCome(ctx, sdk_struct.CmdNewMsgComeToConversation{Msgs: msgs}, m.conversationCh)
if err != nil {
log.ZError(ctx, "triggerCmdNewMsgCome err", err, "msgs", msgs)
if len(msgs) >= 0 {
err := common.TriggerCmdNewMsgCome(ctx, sdk_struct.CmdNewMsgComeToConversation{Msgs: msgs}, m.conversationCh)
if err != nil {
log.ZError(ctx, "triggerCmdNewMsgCome err", err, "msgs", msgs)
}
log.ZDebug(ctx, "triggerConversation", "msgs", msgs)
return err
}
log.ZDebug(ctx, "triggerConversation", "msgs", msgs)
return err
return nil
}

func (m *MsgSyncer) triggerNotification(ctx context.Context, msgs map[string]*sdkws.PullMsgs) error {
err := common.TriggerCmdNotification(ctx, sdk_struct.CmdNewMsgComeToConversation{Msgs: msgs}, m.conversationCh)
if err != nil {
log.ZError(ctx, "triggerCmdNewMsgCome err", err, "msgs", msgs)
if len(msgs) >= 0 {
err := common.TriggerCmdNotification(ctx, sdk_struct.CmdNewMsgComeToConversation{Msgs: msgs}, m.conversationCh)
if err != nil {
log.ZError(ctx, "triggerCmdNewMsgCome err", err, "msgs", msgs)
}
return err
}
return err
return nil

}

0 comments on commit 012a8c4

Please sign in to comment.