Merge branch 'errcode' of github.com:OpenIMSDK/Open-IM-Server into errcode

This commit is contained in:
wangchuxiao
2023-05-19 16:12:06 +08:00
5 changed files with 55 additions and 14 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ func UsersDB2Pb(users []*relationTb.UserModel) (result []*sdkws.UserInfo) {
userPb.Nickname = user.Nickname
userPb.FaceURL = user.FaceURL
userPb.Ex = user.Ex
userPb.CreateTime = user.CreateTime.Unix()
userPb.CreateTime = user.CreateTime.UnixMilli()
userPb.AppMangerLevel = user.AppMangerLevel
userPb.GlobalRecvMsgOpt = user.GlobalRecvMsgOpt
result = append(result, &userPb)
@@ -28,7 +28,7 @@ func UserPb2DB(user *sdkws.UserInfo) *relationTb.UserModel {
userDB.Nickname = user.Nickname
userDB.FaceURL = user.FaceURL
userDB.Ex = user.Ex
userDB.CreateTime = time.Unix(user.CreateTime, 0)
userDB.CreateTime = time.UnixMilli(user.CreateTime)
userDB.AppMangerLevel = user.AppMangerLevel
userDB.GlobalRecvMsgOpt = user.GlobalRecvMsgOpt
return &userDB
+5 -3
View File
@@ -222,9 +222,11 @@ func (c *ConversationDataBase) CreateGroupChatConversation(ctx context.Context,
conversations = append(conversations, &conversation)
}
cache = cache.DelConversationIDs(notExistUserIDs...).DelUserConversationIDsHash(notExistUserIDs...)
err = c.conversationDB.Create(ctx, conversations)
if err != nil {
return err
if len(conversations) > 0 {
err = c.conversationDB.Create(ctx, conversations)
if err != nil {
return err
}
}
_, err = c.conversationDB.UpdateByMap(ctx, existConversationUserIDs, conversationID, map[string]interface{}{"max_seq": 0})
if err != nil {