group notification

This commit is contained in:
withchao 2023-05-19 14:21:18 +08:00
parent 044741ff20
commit 4ae5acefc0

View File

@ -221,9 +221,11 @@ func (c *ConversationDataBase) CreateGroupChatConversation(ctx context.Context,
conversations = append(conversations, &conversation) conversations = append(conversations, &conversation)
} }
cache = cache.DelConversationIDs(notExistUserIDs...).DelUserConversationIDsHash(notExistUserIDs...) cache = cache.DelConversationIDs(notExistUserIDs...).DelUserConversationIDsHash(notExistUserIDs...)
err = c.conversationDB.Create(ctx, conversations) if len(conversations) > 0 {
if err != nil { err = c.conversationDB.Create(ctx, conversations)
return err if err != nil {
return err
}
} }
_, err = c.conversationDB.UpdateByMap(ctx, existConversationUserIDs, conversationID, map[string]interface{}{"max_seq": 0}) _, err = c.conversationDB.UpdateByMap(ctx, existConversationUserIDs, conversationID, map[string]interface{}{"max_seq": 0})
if err != nil { if err != nil {