diff --git a/internal/rpc/msg/server.go b/internal/rpc/msg/server.go index 7ecc98b9c..91c37041a 100644 --- a/internal/rpc/msg/server.go +++ b/internal/rpc/msg/server.go @@ -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 { diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index fe4f169d5..61572db9e 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -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 {