Disable typing indicators in group chats

This commit is contained in:
Niels Andriesse 2019-08-23 09:41:35 +10:00
parent 88403024eb
commit 67b7a1d8c2
3 changed files with 7 additions and 2 deletions

View File

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

View File

@ -96,9 +96,12 @@ public class TypingSendJob extends BaseJob implements InjectableType {
List<Optional<UnidentifiedAccessPair>> unidentifiedAccess = Stream.of(recipients).map(r -> UnidentifiedAccessUtil.getAccessFor(context, r)).toList();
SignalServiceTypingMessage typingMessage = new SignalServiceTypingMessage(typing ? Action.STARTED : Action.STOPPED, System.currentTimeMillis(), groupId);
// Loki - Don't send typing indicators in group chats
if (!recipient.isGroupRecipient()) {
// TODO: Message ID
messageSender.sendTyping(0, addresses, unidentifiedAccess, typingMessage);
}
}
@Override
public void onCanceled() {

View File

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