mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Fixed iOS notifications when it's an emoji reaction
Fixed new nullable variable in wrapper
This commit is contained in:
parent
f28a38d838
commit
2e77d7bc84
4 changed files with 19 additions and 7 deletions
|
|
@ -83,10 +83,11 @@ import linphonesw
|
|||
if let addr = searchResult.address, let foundContact = getContactFromAddr(addr: addr) {
|
||||
return foundContact
|
||||
}
|
||||
|
||||
if searchResult.phoneNumber != nil {
|
||||
if let foundContact = getContactFromPhoneNb(phoneNb: searchResult.phoneNumber!) {
|
||||
return foundContact
|
||||
}
|
||||
return foundContact
|
||||
}
|
||||
}
|
||||
|
||||
// Friend comes from provisioning
|
||||
|
|
|
|||
|
|
@ -625,7 +625,8 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
}
|
||||
|
||||
viewer.imageViewer = image
|
||||
viewer.imageNameViewer = chatMessage.contents.first!.name!.isEmpty ? "" : chatMessage.contents.first!.name!
|
||||
viewer.imageNameViewer = (chatMessage.contents.first!.name!.isEmpty ? "" : chatMessage.contents.first!.name)!
|
||||
|
||||
viewer.imagePathViewer = chatMessage.contents.first!.exportPlainFile()
|
||||
viewer.contentType = chatMessage.contents.first!.type
|
||||
PhoneMainView.instance().changeCurrentView(viewer.compositeViewDescription())
|
||||
|
|
@ -701,7 +702,7 @@ class ChatConversationTableViewSwift: UIViewController, UICollectionViewDataSour
|
|||
}
|
||||
|
||||
viewer.imageViewer = image
|
||||
viewer.imageNameViewer = chatMessage!.contents[index].name!.isEmpty ? "" : chatMessage!.contents[index].name!
|
||||
viewer.imageNameViewer = (chatMessage!.contents[index].name!.isEmpty ? "" : chatMessage!.contents[index].name)!
|
||||
viewer.imagePathViewer = chatMessage!.contents[index].exportPlainFile()
|
||||
viewer.contentType = chatMessage!.contents[index].type
|
||||
PhoneMainView.instance().changeCurrentView(viewer.compositeViewDescription())
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -133,8 +133,13 @@ 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")
|
||||
|
||||
contentHandler(bestAttemptContent)
|
||||
|
||||
if message.reactionContent != " " {
|
||||
contentHandler(bestAttemptContent)
|
||||
}else {
|
||||
contentHandler(UNNotificationContent())
|
||||
}
|
||||
|
||||
return
|
||||
} else {
|
||||
NotificationService.log.message(message: "Message not found for callid ["+callId+"]")
|
||||
|
|
@ -183,6 +188,7 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
let callId = message.callId
|
||||
let localUri = message.localAddr?.asStringUriOnly()
|
||||
let peerUri = message.peerAddr?.asStringUriOnly()
|
||||
let reactionContent = message.reactionContent
|
||||
let from: String
|
||||
if let fromDisplayName = message.fromAddr?.asStringUriOnly().getDisplayNameFromSipAddress(lc: lc!, logger: NotificationService.log, groupId: APP_GROUP_ID) {
|
||||
from = fromDisplayName
|
||||
|
|
@ -196,7 +202,11 @@ class NotificationService: UNNotificationServiceExtension {
|
|||
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 != "" {
|
||||
msgData.subtitle = subject
|
||||
msgData.body = from + " : " + content
|
||||
if reactionContent == nil {
|
||||
msgData.body = from + " : " + content
|
||||
} else {
|
||||
msgData.body = from + NSLocalizedString(" has reacted by ", comment: "") + reactionContent! + NSLocalizedString(" to: ", comment: "") + content
|
||||
}
|
||||
} else {
|
||||
msgData.subtitle = from
|
||||
msgData.body = content
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue