fix blocked contacts can still see typing indicator and set disappearing messages

This commit is contained in:
Ryan ZHAO 2021-03-11 10:52:54 +11:00
parent a3e3f0047a
commit 9ddb45dbdc
2 changed files with 11 additions and 0 deletions

View file

@ -70,6 +70,9 @@ public class ExpiringMessageManager implements SSKEnvironment.MessageExpirationM
MmsDatabase database = DatabaseFactory.getMmsDatabase(context);
Address address = Address.fromSerialized(senderPublicKey);
Recipient recipient = Recipient.from(context, address, false);
if (recipient.isBlocked()) return;
Optional<SignalServiceGroup> groupInfo = Optional.absent();
if (content.getDataMessage().hasGroup()) {
GroupContext groupContext = content.getDataMessage().getGroup();

View file

@ -51,6 +51,10 @@ public class TypingStatusRepository implements SSKEnvironment.TypingIndicatorsPr
return;
}
if (Recipient.from(context, author, false).isBlocked()) {
return;
}
Set<Typist> typists = Util.getOrDefault(typistMap, threadId, new LinkedHashSet<>());
Typist typist = new Typist(Recipient.from(context, author, false), device, threadId);
@ -76,6 +80,10 @@ public class TypingStatusRepository implements SSKEnvironment.TypingIndicatorsPr
return;
}
if (Recipient.from(context, author, false).isBlocked()) {
return;
}
Set<Typist> typists = Util.getOrDefault(typistMap, threadId, new LinkedHashSet<>());
Typist typist = new Typist(Recipient.from(context, author, false), device, threadId);