Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove null trigger conversation. #350

Merged
merged 2 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions internal/conversation_msg/conversation_msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ func (c *Conversation) doMsgNew(c2v common.Cmd2Value) {
if nc.IsPrivateChat {
nc.BurnDuration = v.BurnDuration
}
if v.UnreadCount != 0 {
nc.UnreadCount = v.UnreadCount
}
nc.IsNotInGroup = v.IsNotInGroup
nc.AttachedInfo = v.AttachedInfo
nc.Ex = v.Ex
Expand Down
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

}
Loading