fix: getConversationInfo

pull/2087/head
withchao 8 months ago
parent 7b5279a15b
commit 34daf1307f

@ -506,19 +506,27 @@ func (c *conversationServer) getConversationInfo(
switch chatLog.SessionType { switch chatLog.SessionType {
case constant.SingleChatType: case constant.SingleChatType:
if chatLog.SendID == userID { if chatLog.SendID == userID {
msgInfo.FaceURL = sendMap[chatLog.RecvID].FaceURL if recv, ok := sendMap[chatLog.RecvID]; ok {
msgInfo.SenderName = sendMap[chatLog.RecvID].Nickname msgInfo.FaceURL = recv.FaceURL
msgInfo.SenderName = recv.Nickname
}
break break
} }
msgInfo.FaceURL = sendMap[chatLog.SendID].FaceURL if send, ok := sendMap[chatLog.SendID]; ok {
msgInfo.SenderName = sendMap[chatLog.SendID].Nickname msgInfo.FaceURL = send.FaceURL
msgInfo.SenderName = send.Nickname
}
case constant.GroupChatType, constant.SuperGroupChatType: case constant.GroupChatType, constant.SuperGroupChatType:
msgInfo.GroupName = groupMap[chatLog.GroupID].GroupName
msgInfo.GroupFaceURL = groupMap[chatLog.GroupID].FaceURL
msgInfo.GroupMemberCount = groupMap[chatLog.GroupID].MemberCount
msgInfo.GroupID = chatLog.GroupID msgInfo.GroupID = chatLog.GroupID
msgInfo.GroupType = groupMap[chatLog.GroupID].GroupType if group, ok := groupMap[chatLog.GroupID]; ok {
msgInfo.SenderName = sendMap[chatLog.SendID].Nickname msgInfo.GroupName = group.GroupName
msgInfo.GroupFaceURL = group.FaceURL
msgInfo.GroupMemberCount = group.MemberCount
msgInfo.GroupType = group.GroupType
}
if send, ok := sendMap[chatLog.SendID]; ok {
msgInfo.SenderName = send.Nickname
}
} }
pbchatLog.ConversationID = conversationID pbchatLog.ConversationID = conversationID
msgInfo.LatestMsgRecvTime = chatLog.SendTime msgInfo.LatestMsgRecvTime = chatLog.SendTime

Loading…
Cancel
Save