Fix emoji sending and self push notifications

This commit is contained in:
sevenhill
2026-07-04 21:47:06 +03:00
parent b3192d793d
commit 3e3d1538eb
4 changed files with 248 additions and 8 deletions
@@ -26,6 +26,12 @@ public sealed class FirebasePushNotificationService(
public async Task SendNewMessageAsync(Chat chat, Message message, CancellationToken cancellationToken)
{
var qmax = options.Value;
if (message.Direction != MessageDirection.Incoming)
{
logger.LogDebug("Skipping push for non-incoming message {MessageId} in chat {ChatId}.", message.Id, chat.Id);
return;
}
if (!qmax.PushEnabled || chat.IsMuted)
{
return;
@@ -70,7 +76,8 @@ public sealed class FirebasePushNotificationService(
["body"] = body,
["chatId"] = chat.Id.ToString(),
["messageId"] = message.Id.ToString(),
["chatTitle"] = chat.Title
["chatTitle"] = chat.Title,
["direction"] = message.Direction.ToString()
};
foreach (var device in devices)