Queue chat bulk actions through SQL outbox
This commit is contained in:
@@ -89,6 +89,12 @@ public sealed class MaxBridgeSyncService(
|
||||
}
|
||||
}
|
||||
|
||||
if (chat?.DeletedAt is not null)
|
||||
{
|
||||
trackedChatsByExternalId[update.ExternalId] = chat;
|
||||
continue;
|
||||
}
|
||||
|
||||
var chatWasCreated = chat is null;
|
||||
if (chat is null)
|
||||
{
|
||||
@@ -189,6 +195,11 @@ public sealed class MaxBridgeSyncService(
|
||||
continue;
|
||||
}
|
||||
|
||||
if (chat.HistoryClearedAt is { } historyClearedAt && incoming.SentAt <= historyClearedAt)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (IsPresencePreview(incoming.Text) && (incoming.Attachments?.Count ?? 0) == 0)
|
||||
{
|
||||
continue;
|
||||
@@ -347,6 +358,11 @@ public sealed class MaxBridgeSyncService(
|
||||
var previousPreview = chat.LastMessagePreview;
|
||||
var previousPreviewAt = chat.LastMessageAt;
|
||||
var previewAt = ResolveListPreviewAt(update, previousPreviewAt ?? chat.UpdatedAt);
|
||||
if (chat.HistoryClearedAt is { } historyClearedAt && previewAt <= historyClearedAt)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var samePreview = string.Equals(previousPreview, preview, StringComparison.Ordinal);
|
||||
var samePreviewAt = previousPreviewAt is not null &&
|
||||
Math.Abs((previousPreviewAt.Value - previewAt).TotalSeconds) < 1;
|
||||
|
||||
Reference in New Issue
Block a user