Ensure no typing indicators can be sent to self or blocked recipients.

fork-5.53.8
Alan Evans 2021-02-24 17:04:29 -04:00 zatwierdzone przez GitHub
rodzic 687192f071
commit da56c2790f
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -92,6 +92,12 @@ public class TypingSendJob extends BaseJob {
if (recipient.isBlocked()) {
Log.w(TAG, "Not sending typing indicators to blocked recipients.");
return;
}
if (recipient.isSelf()) {
Log.w(TAG, "Not sending typing indicators to self.");
return;
}
List<Recipient> recipients = Collections.singletonList(recipient);
@ -104,6 +110,7 @@ public class TypingSendJob extends BaseJob {
recipients = RecipientUtil.getEligibleForSending(Stream.of(recipients)
.map(Recipient::resolve)
.filter(r -> !r.isBlocked())
.toList());
SignalServiceMessageSender messageSender = ApplicationDependencies.getSignalServiceMessageSender();
@ -111,6 +118,11 @@ public class TypingSendJob extends BaseJob {
List<Optional<UnidentifiedAccessPair>> unidentifiedAccess = UnidentifiedAccessUtil.getAccessFor(context, recipients);
SignalServiceTypingMessage typingMessage = new SignalServiceTypingMessage(typing ? Action.STARTED : Action.STOPPED, System.currentTimeMillis(), groupId);
if (addresses.isEmpty()) {
Log.w(TAG, "No one to send typing indicators to");
return;
}
if (isCanceled()) {
Log.w(TAG, "Canceled before send!");
return;