mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 10:52:33 +08:00
fix updateUserInfoEx
This commit is contained in:
parent
b39d12aacf
commit
d941c69770
2
go.mod
2
go.mod
@ -4,7 +4,7 @@ go 1.19
|
||||
|
||||
require (
|
||||
firebase.google.com/go v3.13.0+incompatible
|
||||
github.com/OpenIMSDK/protocol v0.0.40
|
||||
github.com/OpenIMSDK/protocol v0.0.42
|
||||
github.com/OpenIMSDK/tools v0.0.21
|
||||
github.com/bwmarrin/snowflake v0.3.0 // indirect
|
||||
github.com/dtm-labs/rockscache v0.1.1
|
||||
|
||||
@ -168,7 +168,7 @@ func (s *userServer) UpdateUserInfoEx(ctx context.Context, req *pbuser.UpdateUse
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if req.UserInfo.Nickname != "" || req.UserInfo.FaceURL != "" {
|
||||
if req.UserInfo.Nickname != nil || req.UserInfo.FaceURL != nil {
|
||||
if err := s.groupRpcClient.NotificationUserInfoUpdate(ctx, req.UserInfo.UserID); err != nil {
|
||||
log.ZError(ctx, "NotificationUserInfoUpdate", err)
|
||||
}
|
||||
|
||||
@ -79,14 +79,18 @@ func UserPb2DBMapEx(user *sdkws.UserInfoWithEx) map[string]any {
|
||||
val := make(map[string]any)
|
||||
|
||||
// Map fields from UserInfoWithEx to val
|
||||
val["nickname"] = user.Nickname
|
||||
val["face_url"] = user.FaceURL
|
||||
|
||||
if user.Nickname != nil {
|
||||
val["nickname"] = user.Nickname.Value
|
||||
}
|
||||
if user.FaceURL != nil {
|
||||
val["face_url"] = user.FaceURL.Value
|
||||
}
|
||||
if user.Ex != nil {
|
||||
val["ex"] = user.Ex.Value
|
||||
}
|
||||
if user.GlobalRecvMsgOpt != 0 {
|
||||
val["global_recv_msg_opt"] = user.GlobalRecvMsgOpt
|
||||
if user.GlobalRecvMsgOpt != nil {
|
||||
val["global_recv_msg_opt"] = user.GlobalRecvMsgOpt.Value
|
||||
}
|
||||
|
||||
return val
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user