fix: don't send typing indicator in unapproved conversation

This commit is contained in:
Harris 2022-03-17 15:38:39 +11:00
parent 8d32b02c16
commit 5ace67fd36
2 changed files with 3 additions and 3 deletions

View File

@ -80,7 +80,7 @@ public class TypingStatusSender {
ThreadDatabase threadDatabase = DatabaseComponent.get(context).threadDatabase(); ThreadDatabase threadDatabase = DatabaseComponent.get(context).threadDatabase();
Recipient recipient = threadDatabase.getRecipientForThreadId(threadId); Recipient recipient = threadDatabase.getRecipientForThreadId(threadId);
if (recipient == null) { return; } if (recipient == null) { return; }
if (!SessionMetaProtocol.shouldSendTypingIndicator(recipient.getAddress())) { return; } if (!SessionMetaProtocol.shouldSendTypingIndicator(recipient)) { return; }
TypingIndicator typingIndicator; TypingIndicator typingIndicator;
if (typingStarted) { if (typingStarted) {
typingIndicator = new TypingIndicator(TypingIndicator.Kind.STARTED); typingIndicator = new TypingIndicator(TypingIndicator.Kind.STARTED);

View File

@ -53,7 +53,7 @@ object SessionMetaProtocol {
} }
@JvmStatic @JvmStatic
fun shouldSendTypingIndicator(address: Address): Boolean { fun shouldSendTypingIndicator(recipient: Recipient): Boolean {
return !address.isGroup return !recipient.isGroupRecipient && recipient.isApproved
} }
} }