fix call notification title and content
This commit is contained in:
parent
e3479107f3
commit
62d730ea30
|
@ -313,24 +313,19 @@ public class NotificationPresenter: NSObject, NotificationsProtocol {
|
|||
AppNotificationUserInfoKey.threadId: thread.id
|
||||
]
|
||||
|
||||
let notificationTitle: String = interaction.previewText(db)
|
||||
let threadName: String = SessionThread.displayName(
|
||||
threadId: thread.id,
|
||||
variant: thread.variant,
|
||||
closedGroupName: nil, // Not supported
|
||||
openGroupName: nil // Not supported
|
||||
)
|
||||
let notificationTitle: String = "Session"
|
||||
let senderName: String = Profile.displayName(db, id: interaction.authorId, threadVariant: thread.variant)
|
||||
let notificationBody: String? = {
|
||||
switch messageInfo.state {
|
||||
case .permissionDenied:
|
||||
return String(
|
||||
format: "modal_call_missed_tips_explanation".localized(),
|
||||
threadName
|
||||
senderName
|
||||
)
|
||||
case .missed:
|
||||
return String(
|
||||
format: "call_missed".localized(),
|
||||
threadName
|
||||
senderName
|
||||
)
|
||||
default:
|
||||
return nil
|
||||
|
@ -354,7 +349,7 @@ public class NotificationPresenter: NSObject, NotificationsProtocol {
|
|||
previewType: previewType,
|
||||
sound: sound,
|
||||
threadVariant: thread.variant,
|
||||
threadName: threadName,
|
||||
threadName: senderName,
|
||||
replacingIdentifier: UUID().uuidString
|
||||
)
|
||||
}
|
||||
|
|
|
@ -157,18 +157,15 @@ public class NSENotificationPresenter: NSObject, NotificationsProtocol {
|
|||
notificationContent.badge = NSNumber(value: newBadgeNumber)
|
||||
CurrentAppContext().appUserDefaults().set(newBadgeNumber, forKey: "currentBadgeNumber")
|
||||
|
||||
notificationContent.title = interaction.previewText(db)
|
||||
notificationContent.title = "Session"
|
||||
notificationContent.body = ""
|
||||
|
||||
let senderName: String = Profile.displayName(db, id: interaction.authorId, threadVariant: thread.variant)
|
||||
|
||||
if messageInfo.state == .permissionDenied {
|
||||
notificationContent.body = String(
|
||||
format: "modal_call_missed_tips_explanation".localized(),
|
||||
SessionThread.displayName(
|
||||
threadId: thread.id,
|
||||
variant: thread.variant,
|
||||
closedGroupName: nil, // Not supported
|
||||
openGroupName: nil // Not supported
|
||||
)
|
||||
senderName
|
||||
)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue