@@ -1049,10 +1049,13 @@ func (c *Conversation) InsertSingleMessageToLocalStorage(callback open_im_sdk_ca
10491049 s := sdk_struct.MsgStruct {}
10501050 common .JsonUnmarshalAndArgsValidate (message , & s , callback , operationID )
10511051 if sendID != c .loginUserID {
1052- friendInfo , _ := c .db .GetFriendInfoByFriendUserID (sendID )
1052+ faceUrl , name , err := c .friend .GetUserNameAndFaceUrlByUid (& tmpCallback {}, sendID , operationID )
1053+ if err != nil {
1054+ log .Error (operationID , "getUserNameAndFaceUrlByUid err" , err .Error (), sendID )
1055+ }
10531056 sourceID = sendID
1054- s .SenderFaceURL = friendInfo . FaceURL
1055- s .SenderNickname = friendInfo . Nickname
1057+ s .SenderFaceURL = faceUrl
1058+ s .SenderNickname = name
10561059 } else {
10571060 sourceID = recvID
10581061 }
@@ -1069,6 +1072,8 @@ func (c *Conversation) InsertSingleMessageToLocalStorage(callback open_im_sdk_ca
10691072 msgStructToLocalChatLog (& localMessage , & s )
10701073 conversation .LatestMsg = utils .StructToJsonString (s )
10711074 conversation .LatestMsgSendTime = s .SendTime
1075+ conversation .FaceURL = s .SenderFaceURL
1076+ conversation .ShowName = s .SenderNickname
10721077 _ = c .insertMessageToLocalStorage (callback , & localMessage , operationID )
10731078 callback .OnSuccess (utils .StructToJsonString (& s ))
10741079 _ = common .TriggerCmdUpdateConversation (common.UpdateConNode {ConID : conversation .ConversationID , Action : constant .AddConOrUpLatMsg , Args : conversation }, c .ch )
@@ -1086,9 +1091,12 @@ func (c *Conversation) InsertGroupMessageToLocalStorage(callback open_im_sdk_cal
10861091 s := sdk_struct.MsgStruct {}
10871092 common .JsonUnmarshalAndArgsValidate (message , & s , callback , operationID )
10881093 if sendID != c .loginUserID {
1089- friendInfo , _ := c .db .GetFriendInfoByFriendUserID (sendID )
1090- s .SenderFaceURL = friendInfo .FaceURL
1091- s .SenderNickname = friendInfo .Nickname
1094+ faceUrl , name , err := c .friend .GetUserNameAndFaceUrlByUid (& tmpCallback {}, sendID , operationID )
1095+ if err != nil {
1096+ log .Error (operationID , "getUserNameAndFaceUrlByUid err" , err .Error (), sendID )
1097+ }
1098+ s .SenderFaceURL = faceUrl
1099+ s .SenderNickname = name
10921100 }
10931101 localMessage := db.LocalChatLog {}
10941102 s .SendID = sendID
@@ -1101,6 +1109,8 @@ func (c *Conversation) InsertGroupMessageToLocalStorage(callback open_im_sdk_cal
11011109 msgStructToLocalChatLog (& localMessage , & s )
11021110 conversation .LatestMsg = utils .StructToJsonString (s )
11031111 conversation .LatestMsgSendTime = s .SendTime
1112+ conversation .FaceURL = s .SenderFaceURL
1113+ conversation .ShowName = s .SenderNickname
11041114 _ = c .insertMessageToLocalStorage (callback , & localMessage , operationID )
11051115 callback .OnSuccess (utils .StructToJsonString (& s ))
11061116 _ = common .TriggerCmdUpdateConversation (common.UpdateConNode {ConID : conversation .ConversationID , Action : constant .AddConOrUpLatMsg , Args : conversation }, c .ch )
0 commit comments