From 5ace67fd36a97c13afad7b4a39ee228db1f84ae2 Mon Sep 17 00:00:00 2001 From: Harris Date: Thu, 17 Mar 2022 15:38:39 +1100 Subject: [PATCH] fix: don't send typing indicator in unapproved conversation --- .../thoughtcrime/securesms/components/TypingStatusSender.java | 2 +- .../org/thoughtcrime/securesms/util/SessionMetaProtocol.kt | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/components/TypingStatusSender.java b/app/src/main/java/org/thoughtcrime/securesms/components/TypingStatusSender.java index c5f815a1ea..c2922fbfc0 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/components/TypingStatusSender.java +++ b/app/src/main/java/org/thoughtcrime/securesms/components/TypingStatusSender.java @@ -80,7 +80,7 @@ public class TypingStatusSender { ThreadDatabase threadDatabase = DatabaseComponent.get(context).threadDatabase(); Recipient recipient = threadDatabase.getRecipientForThreadId(threadId); if (recipient == null) { return; } - if (!SessionMetaProtocol.shouldSendTypingIndicator(recipient.getAddress())) { return; } + if (!SessionMetaProtocol.shouldSendTypingIndicator(recipient)) { return; } TypingIndicator typingIndicator; if (typingStarted) { typingIndicator = new TypingIndicator(TypingIndicator.Kind.STARTED); diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/SessionMetaProtocol.kt b/app/src/main/java/org/thoughtcrime/securesms/util/SessionMetaProtocol.kt index 9d81ed56ee..05b6fe86f8 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/SessionMetaProtocol.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/util/SessionMetaProtocol.kt @@ -53,7 +53,7 @@ object SessionMetaProtocol { } @JvmStatic - fun shouldSendTypingIndicator(address: Address): Boolean { - return !address.isGroup + fun shouldSendTypingIndicator(recipient: Recipient): Boolean { + return !recipient.isGroupRecipient && recipient.isApproved } } \ No newline at end of file