mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 11:08:06 +00:00
Fix reaction in app extension for 1-1 chatrooms
This commit is contained in:
parent
9308c4d104
commit
a1b580b78a
1 changed files with 6 additions and 13 deletions
|
|
@ -150,7 +150,6 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
}
|
||||
|
||||
stopCore()
|
||||
|
||||
bestAttemptContent.sound = UNNotificationSound(named: UNNotificationSoundName(rawValue: "msg.caf"))
|
||||
bestAttemptContent.title = NSLocalizedString("Message received", comment: "")
|
||||
if let subtitle = msgData?.subtitle {
|
||||
|
|
@ -166,7 +165,6 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
bestAttemptContent.userInfo.updateValue(msgData?.from as Any, forKey: "from")
|
||||
bestAttemptContent.userInfo.updateValue(msgData?.peerAddr as Any, forKey: "peer_addr")
|
||||
bestAttemptContent.userInfo.updateValue(msgData?.localAddr as Any, forKey: "local_addr")
|
||||
|
||||
if message.reactionContent != " " {
|
||||
contentHandler(bestAttemptContent)
|
||||
} else {
|
||||
|
|
@ -233,20 +231,15 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
var msgData = MsgData(from: fromAddr, body: "", subtitle: "", callId: callId, localAddr: localUri, peerAddr: peerUri)
|
||||
|
||||
if let showMsg = lc!.config?.getBool(section: "app", key: "show_msg_in_notif", defaultValue: true), showMsg == true {
|
||||
if let subject = message.subject as String?, !subject.isEmpty {
|
||||
msgData.subtitle = subject
|
||||
if reactionContent == nil {
|
||||
msgData.body = from + " : " + content
|
||||
} else {
|
||||
msgData.body = from + NSLocalizedString(" has reacted by ", comment: "") + reactionContent! + NSLocalizedString(" to: ", comment: "") + content
|
||||
}
|
||||
msgData.subtitle = message.subject ?? from
|
||||
if reactionContent == nil {
|
||||
msgData.body = (message.subject != nil ? "\(from): " : "") + content
|
||||
} else {
|
||||
msgData.subtitle = from
|
||||
msgData.body = content
|
||||
msgData.body = from + NSLocalizedString(" has reacted by ", comment: "") + reactionContent! + NSLocalizedString(" to: ", comment: "") + content
|
||||
}
|
||||
} else {
|
||||
if let subject = message.subject as String?, !subject.isEmpty {
|
||||
msgData.body = subject + " : " + from
|
||||
if let subject = message.subject {
|
||||
msgData.body = subject + ": " + from
|
||||
} else {
|
||||
msgData.body = from
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue