mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-10-25 04:32:10 +08:00
fix: GetSortedConversationList nil pointer when chatlog not found in v3.8.3-patch branch. (#3569)
This commit is contained in:
parent
dc7ce098cd
commit
310d70b64e
@ -168,7 +168,18 @@ func (c *conversationServer) GetSortedConversationList(ctx context.Context, req
|
|||||||
conversation_notPinTime := make(map[int64]string)
|
conversation_notPinTime := make(map[int64]string)
|
||||||
for _, v := range conversations {
|
for _, v := range conversations {
|
||||||
conversationID := v.ConversationID
|
conversationID := v.ConversationID
|
||||||
time := conversationMsg[conversationID].MsgInfo.LatestMsgRecvTime
|
var time int64
|
||||||
|
if _, ok := conversationMsg[conversationID]; ok {
|
||||||
|
time = conversationMsg[conversationID].MsgInfo.LatestMsgRecvTime
|
||||||
|
} else {
|
||||||
|
conversationMsg[conversationID] = &pbconversation.ConversationElem{
|
||||||
|
ConversationID: conversationID,
|
||||||
|
IsPinned: v.IsPinned,
|
||||||
|
MsgInfo: nil,
|
||||||
|
}
|
||||||
|
time = v.CreateTime.UnixMilli()
|
||||||
|
}
|
||||||
|
|
||||||
conversationMsg[conversationID].RecvMsgOpt = v.RecvMsgOpt
|
conversationMsg[conversationID].RecvMsgOpt = v.RecvMsgOpt
|
||||||
if v.IsPinned {
|
if v.IsPinned {
|
||||||
conversationMsg[conversationID].IsPinned = v.IsPinned
|
conversationMsg[conversationID].IsPinned = v.IsPinned
|
||||||
@ -220,6 +231,7 @@ func (c *conversationServer) getConversations(ctx context.Context, ownerUserID s
|
|||||||
return convert.ConversationsDB2Pb(conversations), nil
|
return convert.ConversationsDB2Pb(conversations), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Deprecated
|
||||||
func (c *conversationServer) SetConversation(ctx context.Context, req *pbconversation.SetConversationReq) (*pbconversation.SetConversationResp, error) {
|
func (c *conversationServer) SetConversation(ctx context.Context, req *pbconversation.SetConversationReq) (*pbconversation.SetConversationResp, error) {
|
||||||
var conversation dbModel.Conversation
|
var conversation dbModel.Conversation
|
||||||
if err := datautil.CopyStructFields(&conversation, req.Conversation); err != nil {
|
if err := datautil.CopyStructFields(&conversation, req.Conversation); err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user