From 52eaa8cdebcdc1ec05e99029c703478019ce77ad Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Tue, 2 Mar 2021 15:15:57 +1100 Subject: [PATCH] Disable data extraction notifications for now --- Session/Conversations/ConversationVC+Interaction.swift | 6 ++++++ .../Sending & Receiving/MessageReceiver+Handling.swift | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Session/Conversations/ConversationVC+Interaction.swift b/Session/Conversations/ConversationVC+Interaction.swift index 17bc8b56b..3cc140b66 100644 --- a/Session/Conversations/ConversationVC+Interaction.swift +++ b/Session/Conversations/ConversationVC+Interaction.swift @@ -657,21 +657,27 @@ extension ConversationVC : InputViewDelegate, MessageCellDelegate, ContextMenuAc // MARK: Data Extraction Notifications @objc func sendScreenshotNotificationIfNeeded() { + // Disabled until other platforms implement it as well + /* guard thread is TSContactThread else { return } let message = DataExtractionNotification() message.kind = .screenshot Storage.write { transaction in MessageSender.send(message, in: self.thread, using: transaction) } + */ } func sendMediaSavedNotificationIfNeeded(with timestamp: UInt64) { + // Disabled until other platforms implement it as well + /* guard thread is TSContactThread else { return } let message = DataExtractionNotification() message.kind = .mediaSaved(timestamp: timestamp) Storage.write { transaction in MessageSender.send(message, in: self.thread, using: transaction) } + */ } // MARK: Requesting Permission diff --git a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift index a389b9d5d..351106319 100644 --- a/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift +++ b/SessionMessagingKit/Sending & Receiving/MessageReceiver+Handling.swift @@ -110,7 +110,7 @@ extension MessageReceiver { private static func handleDataExtractionNotification(_ message: DataExtractionNotification, using transaction: Any) { let transaction = transaction as! YapDatabaseReadWriteTransaction guard message.groupPublicKey == nil, - let thread = TSContactThread.getWithContactId(message.sender!, transaction: transaction) else { return } + let thread = TSContactThread.getWithContactId(message.sender!, transaction: transaction), case .screenshot = message.kind else { return } let type: TSInfoMessageType switch message.kind! { case .screenshot: type = .screenshotNotification