mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-25 05:27:42 +00:00
Ensure no typing indicators can be sent to self or blocked recipients.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user