Кроссплатформенный аудит: reply-бар, файлы, аватар, blurhash — 10 фиксов Desktop/Android-parity
This commit is contained in:
@@ -79,6 +79,38 @@ final class NotificationService: UNNotificationServiceExtension {
|
||||
return
|
||||
}
|
||||
|
||||
// MARK: type=call — incoming call notification (no badge increment).
|
||||
// Server sends this when someone calls and the recipient's WebSocket is not connected.
|
||||
// NSE adds sound for vibration and caller name; no badge (calls don't affect unread).
|
||||
if pushType == "call" {
|
||||
content.sound = .default
|
||||
content.categoryIdentifier = "call"
|
||||
|
||||
let callerKey = content.userInfo["from"] as? String
|
||||
?? Self.extractSenderKey(from: content.userInfo)
|
||||
let contactNames = shared?.dictionary(forKey: "contact_display_names") as? [String: String] ?? [:]
|
||||
let callerName = contactNames[callerKey]
|
||||
?? Self.firstNonBlank(content.userInfo, keys: Self.senderNameKeyNames)
|
||||
|
||||
if let callerName, !callerName.isEmpty, content.title.isEmpty {
|
||||
content.title = callerName
|
||||
}
|
||||
if content.body.isEmpty {
|
||||
content.body = "Incoming call"
|
||||
}
|
||||
|
||||
var updatedInfo = content.userInfo
|
||||
if !callerKey.isEmpty {
|
||||
updatedInfo["sender_public_key"] = callerKey
|
||||
updatedInfo["type"] = "call"
|
||||
}
|
||||
content.userInfo = updatedInfo
|
||||
content.interruptionLevel = .timeSensitive
|
||||
|
||||
contentHandler(content)
|
||||
return
|
||||
}
|
||||
|
||||
// MARK: Message types (personal_message / group_message)
|
||||
|
||||
// 1. Add sound for vibration — server APNs payload has no sound field.
|
||||
|
||||
Reference in New Issue
Block a user