For atomic Groups V2 block and leave, block after leaving group.

master
Alan Evans 2020-07-21 06:04:44 -03:00 committed by GitHub
parent 89a940ec81
commit 93f587b851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -97,17 +97,17 @@ public class RecipientUtil {
throw new AssertionError("Recipient is not blockable!");
}
Recipient resolved = recipient.resolve();
recipient = recipient.resolve();
DatabaseFactory.getRecipientDatabase(context).setBlocked(resolved.getId(), true);
if (resolved.isGroup() && recipient.getGroupId().get().isPush()) {
if (recipient.isGroup() && recipient.getGroupId().get().isPush()) {
GroupManager.leaveGroupFromBlockOrMessageRequest(context, recipient.getGroupId().get().requirePush());
}
if (resolved.isSystemContact() || resolved.isProfileSharing() || isProfileSharedViaGroup(context,resolved)) {
DatabaseFactory.getRecipientDatabase(context).setBlocked(recipient.getId(), true);
if (recipient.isSystemContact() || recipient.isProfileSharing() || isProfileSharedViaGroup(context, recipient)) {
ApplicationDependencies.getJobManager().add(new RotateProfileKeyJob());
DatabaseFactory.getRecipientDatabase(context).setProfileSharing(resolved.getId(), false);
DatabaseFactory.getRecipientDatabase(context).setProfileSharing(recipient.getId(), false);
}
ApplicationDependencies.getJobManager().add(new MultiDeviceBlockedUpdateJob());