feat: GetConversationsHasReadAndMaxSeq support pinned

This commit is contained in:
withchao
2025-04-14 11:05:27 +08:00
parent 6e0da23f14
commit d2c7b3ca9c
4 changed files with 35 additions and 5 deletions
+7
View File
@@ -61,6 +61,13 @@ func (m *msgServer) GetConversationsHasReadAndMaxSeq(ctx context.Context, req *m
return nil, err
}
resp := &msg.GetConversationsHasReadAndMaxSeqResp{Seqs: make(map[string]*msg.Seqs)}
if req.ReturnPinned {
pinnedConversations, err := m.ConversationLocalCache.GetPinnedConversations(ctx, req.UserID)
if err != nil {
return nil, err
}
resp.PinnedConversationIDs = pinnedConversations
}
for conversationID, maxSeq := range maxSeqs {
resp.Seqs[conversationID] = &msg.Seqs{
HasReadSeq: hasReadSeqs[conversationID],