Fix media notifications and photo bubbles

This commit is contained in:
sevenhill
2026-07-06 13:17:47 +03:00
parent 61d7aae7eb
commit 30361370da
4 changed files with 78 additions and 18 deletions
+7
View File
@@ -873,6 +873,7 @@ public sealed class ApiSmokeTests : IDisposable
[Fact]
public async Task SyncDoesNotCreateTextOnlyMessageForGenericMediaPreviewOnlyIncomingUpdate()
{
var pushNotifications = new RecordingPushNotificationService();
var marker = Guid.NewGuid().ToString("N");
var externalId = $"generic-media-sync-chat-{marker}";
var now = DateTimeOffset.UtcNow;
@@ -899,7 +900,9 @@ public sealed class ApiSmokeTests : IDisposable
{
services.RemoveAll<IHostedService>();
services.RemoveAll<IMaxBridgeClient>();
services.RemoveAll<IPushNotificationService>();
services.AddSingleton<IMaxBridgeClient>(bridge);
services.AddSingleton<IPushNotificationService>(pushNotifications);
});
});
using var client = factory.CreateClient();
@@ -926,6 +929,10 @@ public sealed class ApiSmokeTests : IDisposable
x.ChatId == chat.Id &&
x.ExternalId != null &&
x.ExternalId.StartsWith("preview:")));
var previewPush = Assert.Single(pushNotifications.SentMessages);
Assert.Equal(chat.Id, previewPush.Chat.Id);
Assert.Equal("\u041c\u0435\u0434\u0438\u0430", previewPush.Message.Text);
Assert.Equal(MessageDirection.Incoming, previewPush.Message.Direction);
}
[Fact]