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();
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);

View File

@ -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
}
}