notification conversationIDs

test-errcode
wangchuxiao 2 years ago
parent b64e9af92f
commit 0d881c2139

@ -131,6 +131,9 @@ func (m *msgServer) GetMaxSeq(ctx context.Context, req *sdkws.GetMaxSeqReq) (*sd
if err != nil {
return nil, err
}
for _, conversationID := range conversationIDs {
conversationIDs = append(conversationIDs, utils.GetNotificationConvetstionID(conversationID))
}
log.ZDebug(ctx, "GetMaxSeq", "conversationIDs", conversationIDs)
maxSeqs, err := m.MsgDatabase.GetMaxSeqs(ctx, conversationIDs)
if err != nil {

@ -239,6 +239,15 @@ func IsNotification(conversationID string) bool {
return strings.HasPrefix(conversationID, "n_")
}
func GetNotificationConvetstionID(conversationID string) string {
l := strings.Split(conversationID, "_")
if len(l) > 2 {
l[0] = "n"
return strings.Join(l, "_")
}
return ""
}
type MsgBySeq []*sdkws.MsgData
func (s MsgBySeq) Len() int {

Loading…
Cancel
Save