Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release

This commit is contained in:
wangchuxiao
2023-01-13 19:47:47 +08:00
9 changed files with 88 additions and 63 deletions
+21
View File
@@ -743,6 +743,27 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
resp.ErrMsg = constant.ErrDB.ErrMsg
return &resp, nil
}
reqPb := pbConversation.ModifyConversationFieldReq{Conversation: &pbConversation.Conversation{}}
reqPb.OperationID = req.OperationID
reqPb.UserIDList = okUserIDList
reqPb.FieldType = constant.FieldUnread
reqPb.Conversation.GroupID = req.GroupID
reqPb.Conversation.ConversationID = utils.GetConversationIDBySessionType(req.GroupID, constant.SuperGroupChatType)
reqPb.Conversation.ConversationType = int32(constant.SuperGroupChatType)
reqPb.Conversation.UpdateUnreadCountTime = utils.GetCurrentTimestampByMill()
etcdConn := getcdv3.GetDefaultConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImConversationName, req.OperationID)
if etcdConn == nil {
errMsg := req.OperationID + "getcdv3.GetDefaultConn == nil"
log.NewError(req.OperationID, errMsg)
}
client := pbConversation.NewConversationClient(etcdConn)
respPb, err := client.ModifyConversationField(context.Background(), &reqPb)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "ModifyConversationField rpc failed, ", reqPb.String(), err.Error())
} else {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "ModifyConversationField success", respPb.String())
}
}
if groupInfo.GroupType != constant.SuperGroup {
+14 -12
View File
@@ -300,18 +300,19 @@ func (rpc *rpcChat) AddMessageReactionExtensions(ctx context.Context, req *msg.A
}
return &rResp, nil
}
if !req.IsExternalExtensions {
rResp.ErrCode = 200
rResp.ErrMsg = "only extenalextensions message can be used"
for _, value := range req.ReactionExtensionList {
temp := new(msg.KeyValueResp)
temp.KeyValue = value
temp.ErrMsg = callbackResp.ErrMsg
temp.ErrCode = 100
rResp.Result = append(rResp.Result, temp)
}
return &rResp, nil
}
//if !req.IsExternalExtensions {
// rResp.ErrCode = 200
// rResp.ErrMsg = "only extenalextensions message can be used"
// for _, value := range req.ReactionExtensionList {
// temp := new(msg.KeyValueResp)
// temp.KeyValue = value
// temp.ErrMsg = callbackResp.ErrMsg
// temp.ErrCode = 100
// rResp.Result = append(rResp.Result, temp)
// }
// return &rResp, nil
//}
//if ExternalExtension
var isHistory bool
if req.IsReact {
@@ -321,6 +322,7 @@ func (rpc *rpcChat) AddMessageReactionExtensions(ctx context.Context, req *msg.A
}
rResp.MsgFirstModifyTime = callbackResp.MsgFirstModifyTime
rResp.Result = callbackResp.ResultReactionExtensionList
rResp.IsReact = callbackResp.IsReact
ExtendMessageAddedNotification(req.OperationID, req.OpUserID, req.SourceID, req.SessionType, req, &rResp, isHistory, false)
return &rResp, nil
}