From 67b7a1d8c21e13626f64124666b588eb4fc2c41d Mon Sep 17 00:00:00 2001 From: Niels Andriesse Date: Fri, 23 Aug 2019 09:41:35 +1000 Subject: [PATCH] Disable typing indicators in group chats --- src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java | 1 + src/org/thoughtcrime/securesms/jobs/TypingSendJob.java | 7 +++++-- .../securesms/notifications/MarkReadReceiver.java | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java index a541ae727b..c9e651a51d 100644 --- a/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java +++ b/src/org/thoughtcrime/securesms/jobs/PushDecryptJob.java @@ -314,6 +314,7 @@ public class PushDecryptJob extends BaseJob implements InjectableType { handleProfileKey(content, message); } + // Loki - This doesn't get invoked for group chats if (content.isNeedsReceipt()) { handleNeedsDeliveryReceipt(content, message); } diff --git a/src/org/thoughtcrime/securesms/jobs/TypingSendJob.java b/src/org/thoughtcrime/securesms/jobs/TypingSendJob.java index a803671e58..d1dc6e53fb 100644 --- a/src/org/thoughtcrime/securesms/jobs/TypingSendJob.java +++ b/src/org/thoughtcrime/securesms/jobs/TypingSendJob.java @@ -96,8 +96,11 @@ public class TypingSendJob extends BaseJob implements InjectableType { List> unidentifiedAccess = Stream.of(recipients).map(r -> UnidentifiedAccessUtil.getAccessFor(context, r)).toList(); SignalServiceTypingMessage typingMessage = new SignalServiceTypingMessage(typing ? Action.STARTED : Action.STOPPED, System.currentTimeMillis(), groupId); - // TODO: Message ID - messageSender.sendTyping(0, addresses, unidentifiedAccess, typingMessage); + // Loki - Don't send typing indicators in group chats + if (!recipient.isGroupRecipient()) { + // TODO: Message ID + messageSender.sendTyping(0, addresses, unidentifiedAccess, typingMessage); + } } @Override diff --git a/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java b/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java index a6d92782ef..e64f395a3c 100644 --- a/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java +++ b/src/org/thoughtcrime/securesms/notifications/MarkReadReceiver.java @@ -86,6 +86,7 @@ public class MarkReadReceiver extends BroadcastReceiver { .collect(Collectors.groupingBy(SyncMessageId::getAddress)); for (Address address : addressMap.keySet()) { + // Loki - This also prevents read receipts from being sent in group chats as they don't maintain a friend request status LokiThreadDatabase lokiThreadDatabase = DatabaseFactory.getLokiThreadDatabase(context); long threadID = lokiThreadDatabase.getThreadID(address.serialize()); LokiThreadFriendRequestStatus friendRequestStatus = lokiThreadDatabase.getFriendRequestStatus(threadID);