Исправлены push-уведомления: восстановлена подписка токена и fallback обработки
This commit is contained in:
@@ -132,6 +132,19 @@ class RosettaFirebaseMessagingService : FirebaseMessagingService() {
|
||||
handledMessageData = true
|
||||
}
|
||||
}
|
||||
|
||||
val looksLikeMessagePayload =
|
||||
type.contains("message") ||
|
||||
data.keys.any { key ->
|
||||
val lower = key.lowercase(Locale.ROOT)
|
||||
lower.contains("message") ||
|
||||
lower.contains("text") ||
|
||||
lower.contains("body")
|
||||
}
|
||||
if (!handledMessageData && !isReadEvent && looksLikeMessagePayload) {
|
||||
showSimpleNotification(senderName, messagePreview)
|
||||
handledMessageData = true
|
||||
}
|
||||
}
|
||||
|
||||
// Обрабатываем notification payload (если есть).
|
||||
@@ -164,11 +177,6 @@ class RosettaFirebaseMessagingService : FirebaseMessagingService() {
|
||||
}
|
||||
lastNotifTimestamps[dedupKey] = now
|
||||
Log.d(TAG, "\u2705 Showing notification for key=$dedupKey")
|
||||
// Desktop parity: suppress notifications during sync (useDialogFiber.ts checks
|
||||
// protocolState != ProtocolState.SYNCHRONIZATION before calling notify()).
|
||||
if (ProtocolManager.syncInProgress.value) {
|
||||
return
|
||||
}
|
||||
val senderKey = senderPublicKey?.trim().orEmpty()
|
||||
if (senderKey.isNotEmpty() && isDialogMuted(senderKey)) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user