kopia lustrzana https://github.com/ryukoposting/Signal-Android
Ensure no typing indicators can be sent to self or blocked recipients.
rodzic
687192f071
commit
da56c2790f
|
@ -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;
|
||||
|
|
Ładowanie…
Reference in New Issue