conversation update

This commit is contained in:
Gordon 2022-08-21 23:56:44 +08:00
parent 621051cfb9
commit 24137bffdd

View File

@ -74,6 +74,7 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo
err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"attached_info": conversation.AttachedInfo}) err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"attached_info": conversation.AttachedInfo})
case constant.FieldUnread: case constant.FieldUnread:
isSyncConversation = false isSyncConversation = false
err = imdb.UpdateColumnsConversations(haveUserID, req.Conversation.ConversationID, map[string]interface{}{"update_unread_count_time": utils.GetCurrentTimestampByMill()})
} }
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateColumnsConversations error", err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), "UpdateColumnsConversations error", err.Error())
@ -82,6 +83,7 @@ func (rpc *rpcConversation) ModifyConversationField(c context.Context, req *pbCo
} }
for _, v := range utils.DifferenceString(haveUserID, req.UserIDList) { for _, v := range utils.DifferenceString(haveUserID, req.UserIDList) {
conversation.OwnerUserID = v conversation.OwnerUserID = v
conversation.UpdateUnreadCountTime = utils.GetCurrentTimestampByMill()
err := imdb.SetOneConversation(conversation) err := imdb.SetOneConversation(conversation)
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())