Skip to content

Commit

Permalink
fix: apply in common group
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Oct 26, 2024
1 parent a06e17f commit ab96a81
Showing 1 changed file with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,13 +253,9 @@ void forEach(Utilities.IndexedConsumer<TLObject> action) {
}
}

boolean checkOption(TLObject object) {
for (int i = 0; i < totalCount; i++) {
if (object == options.get(i)) {
return checks[i] && (filter == null || filter[i]);
}
}
return false;
boolean checkOption(int i) {
if (i > totalCount) return false;
return checks[i] && (filter == null || filter[i]);
}
}

Expand Down Expand Up @@ -1009,8 +1005,8 @@ private void performDelete() {

applyInCommonGroup.forEachSelected((participant, i) -> {
if (participant instanceof TLRPC.User) {
boolean needBan = banOrRestrict.checkOption(participant);
boolean needDelete = banOrRestrict.checkOption(participant);
boolean needBan = banOrRestrict.checkOption(i);
boolean needDelete = deleteAll.checkOption(i);
if (!needBan && !needDelete) {
return;
}
Expand All @@ -1034,9 +1030,9 @@ private void performDelete() {
if (canBan && needBan) {
if (restrict) {
TLRPC.TL_chatBannedRights rights = bannedRightsOr(bannedRights, participantsBannedRights.get(i));
MessagesController.getInstance(currentAccount).setParticipantBannedRole(chat_.id, (TLRPC.User) participant, null, rights, false, getBaseFragment());
MessagesController.getInstance(currentAccount).setParticipantBannedRole(chat_.id, userFinal, null, rights, false, getBaseFragment());
} else {
MessagesController.getInstance(currentAccount).deleteParticipantFromChat(chat_.id, (TLRPC.User) participant, null, false, false);
MessagesController.getInstance(currentAccount).deleteParticipantFromChat(chat_.id, userFinal, null, false, false);
}
}
if (canDelete && needDelete) {
Expand Down

0 comments on commit ab96a81

Please sign in to comment.