mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Minor cleanup
This commit is contained in:
parent
c132b16d01
commit
eb29b5d641
1 changed files with 3 additions and 2 deletions
|
@ -38,7 +38,7 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension
|
|||
let (message, proto) = try MessageReceiver.parse(envelopeAsData, openGroupMessageServerID: nil, using: transaction)
|
||||
let senderPublicKey = message.sender!
|
||||
if (senderPublicKey == userPublicKey) {
|
||||
// Ignore PNs of messages sent from current user.
|
||||
// Ignore PNs for messages sent by the current user
|
||||
return self.completeSilenty()
|
||||
}
|
||||
var senderDisplayName = Storage.shared.getContact(with: senderPublicKey)?.displayName(for: .regular) ?? senderPublicKey
|
||||
|
@ -52,6 +52,7 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension
|
|||
}
|
||||
let thread = tsIncomingMessage.thread(with: transaction)
|
||||
if thread.isMuted {
|
||||
// Ignore PNs if the thread is muted
|
||||
return self.completeSilenty()
|
||||
}
|
||||
let threadID = thread.uniqueId!
|
||||
|
@ -62,7 +63,7 @@ public final class NotificationServiceExtension : UNNotificationServiceExtension
|
|||
group.groupModel.groupType == .closedGroup { // Should always be true because we don't get PNs for open groups
|
||||
senderDisplayName = String(format: NotificationStrings.incomingGroupMessageTitleFormat, senderDisplayName, group.groupModel.groupName ?? MessageStrings.newGroupDefaultTitle)
|
||||
if group.isOnlyNotifyingForMentions && !tsIncomingMessage.isUserMentioned {
|
||||
// Ignore PNs if the group is set to only notify mentions
|
||||
// Ignore PNs if the group is set to only notify for mentions
|
||||
return self.completeSilenty()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue