Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
LiuYi0526 committed Oct 26, 2024
2 parents 7e19e70 + ab96a81 commit 41d8c62
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3737,7 +3737,7 @@ private void createSenderSelectView() {
if (chatFull != null) {

var chat = controller.getChat(chatFull.id);
if (chat != null && chat.creator) {
if (chat != null && ChatObject.isMegagroup(chat) && chat.creator) {
var self = UserConfig.getInstance(currentAccount).getCurrentUser();

if (peer.channel_id == chat.id) {
Expand Down
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
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected int getSuggestedMinimumWidth() {

if (NaConfig.INSTANCE.getQuickToggleAnonymous().Bool()) {
var chat = messagesController.getChat(chatFull.id);
if (chat != null && chat.creator) {
if (chat != null && ChatObject.isMegagroup(chat) && chat.creator) {
if (peers.stream().noneMatch(peer -> peer.peer.channel_id == chat.id)) {
peers.add(peers.size() >= 1 ? 1 : 0, new TLRPC.TL_sendAsPeer() {{
peer = new TLRPC.TL_peerChannel() {{ channel_id = chat.id; }};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1482,7 +1482,7 @@ public SharedMediaLayout(Context context, long did, SharedMediaPreloader preload
this.initialTab = TAB_BOT_PREVIEWS;
} else if (userInfo != null && userInfo.bot_info != null && userInfo.bot_info.has_preview_medias) {
this.initialTab = TAB_STORIES;
} else if (NaConfig.INSTANCE.getDisableStories().Bool() && (userInfo != null && userInfo.stories_pinned_available || chatInfo != null && chatInfo.stories_pinned_available || isStoriesView())) {
} else if (!NaConfig.INSTANCE.getDisableStories().Bool() && (userInfo != null && userInfo.stories_pinned_available || chatInfo != null && chatInfo.stories_pinned_available || isStoriesView())) {
this.initialTab = getInitialTab();
} else if (userInfo != null && userInfo.stargifts_count > 0) {
this.initialTab = TAB_GIFTS;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9319,10 +9319,10 @@ private void updateRowsIds() {
setAvatarSectionRow = rowCount++;
}
numberSectionRow = rowCount++;
setUsernameRow = rowCount++;
if (!hideNumber) {
numberRow = rowCount++;
}
setUsernameRow = rowCount++;
bioRow = rowCount++;

settingsSectionRow = rowCount++;
Expand Down

0 comments on commit 41d8c62

Please sign in to comment.