From c391317c70a25f549fbafec3525b027c850b7b82 Mon Sep 17 00:00:00 2001 From: Ivan Sein Date: Thu, 14 Nov 2024 12:20:25 +0100 Subject: [PATCH] Remove NotificationCenter observer when leaving chat. Signed-off-by: Ivan Sein --- NextcloudTalk/ChatViewController.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NextcloudTalk/ChatViewController.swift b/NextcloudTalk/ChatViewController.swift index 0f3649c32..a74c212f9 100644 --- a/NextcloudTalk/ChatViewController.swift +++ b/NextcloudTalk/ChatViewController.swift @@ -649,6 +649,10 @@ import UIKit self.messageExpirationTimer?.invalidate() self.chatController.stop() + // Dismiss possible notifications + // swiftlint:disable:next notification_center_detachment + NotificationCenter.default.removeObserver(self) + // In case we're typing when we leave the chat, make sure we notify everyone // The 'stopTyping' method makes sure to only send signaling messages when we were typing before self.stopTyping(force: false)