mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-17 02:58:07 +00:00
Do not create local push notifications inside muted chatrooms
This commit is contained in:
parent
577706ae16
commit
940bfd3a81
1 changed files with 10 additions and 1 deletions
|
|
@ -39,12 +39,21 @@ class LocalPushProvider: NEAppPushProvider {
|
|||
var aggretatorTimer:Timer? = nil
|
||||
var aggregagor:[ChatMessage] = []
|
||||
|
||||
func chatRoomMuted(chatRoom:ChatRoom) -> Bool {
|
||||
if let chatroomsPushStatus = defaults?.dictionary(forKey: "chatroomsPushStatus"), let from = chatRoom.peerAddress?.asStringUriOnly() {
|
||||
if ((chatroomsPushStatus[from] as? String) == "disabled") {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func createCore() throws {
|
||||
coreDelegateStub = CoreDelegateStub(
|
||||
onMessageReceived: { (core:Core, chatRoom:ChatRoom, message:ChatMessage) -> Void in
|
||||
if (self.ignoredContentTypes.contains(message.contentType)) {
|
||||
self.log.error(message: "Received unexpected content type.\(message.contentType)")
|
||||
} else {
|
||||
} else if (!self.chatRoomMuted(chatRoom: chatRoom)) {
|
||||
self.aggregagor.append(message)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue