fix: don't send typing indicator in unapproved conversation

pull/860/head
Harris 4 years ago
parent 8d32b02c16
commit 5ace67fd36

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

@ -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
}
}
Loading…
Cancel
Save