fix not found display name of message

This commit is contained in:
Danmei Chen 2021-01-15 18:27:54 +01:00
parent 779c939e78
commit bf33513300

View file

@ -220,13 +220,17 @@ class NotificationService: UNNotificationServiceExtension {
return nil
}
if let displayName = addressBook?[sipAddr] as? String {
NotificationService.log.message(message: "display name for \(sipAddr): \(displayName)")
return displayName
} else {
NotificationService.log.message(message: "display name for \(sipAddr) not found in userDefaults")
return nil
if let simpleAddr = lc?.interpretUrl(url: sipAddr) {
simpleAddr.clean()
let nomalSipaddr = simpleAddr.asString()
if let displayName = addressBook?[nomalSipaddr] as? String {
NotificationService.log.message(message: "display name for \(sipAddr): \(displayName)")
return displayName
}
}
NotificationService.log.message(message: "display name for \(sipAddr) not found in userDefaults")
return nil
}
return nil
}