Skip to content

Commit

Permalink
feat: show write Button for megagroup
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Feb 8, 2024
1 parent 99fc6e7 commit 93394e3
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions TMessagesProj/src/main/java/org/telegram/ui/ProfileActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -4919,8 +4919,13 @@ protected void onLongPress() {
writeButton.setContentDescription(LocaleController.getString("AccDescrOpenChat", R.string.AccDescrOpenChat));
}
} else {
writeButton.setImageResource(R.drawable.profile_discuss);
writeButton.setContentDescription(LocaleController.getString("ViewDiscussion", R.string.ViewDiscussion));
if (currentChat.megagroup) {
writeButton.setImageResource(R.drawable.msg_channel);
writeButton.setContentDescription(LocaleController.getString("OpenChannel2", R.string.OpenChannel2));
} else {
writeButton.setImageResource(R.drawable.profile_discuss);
writeButton.setContentDescription(LocaleController.getString("ViewDiscussion", R.string.ViewDiscussion));
}
}
writeButton.setColorFilter(new PorterDuffColorFilter(getThemedColor(Theme.key_profile_actionIcon), PorterDuff.Mode.SRC_IN));
writeButton.setScaleType(ImageView.ScaleType.CENTER);
Expand Down Expand Up @@ -6844,7 +6849,8 @@ private void needLayout(boolean animated) {

boolean writeButtonVisible = diff > 0.2f && !searchMode && (imageUpdater == null || setAvatarRow == -1);
if (writeButtonVisible && chatId != 0) {
writeButtonVisible = ChatObject.isChannel(currentChat) && !currentChat.megagroup && chatInfo != null && chatInfo.linked_chat_id != 0 && infoHeaderRow != -1;
// na: show write Button for currentChat.megagroup
writeButtonVisible = ChatObject.isChannel(currentChat) && chatInfo != null && chatInfo.linked_chat_id != 0 && infoHeaderRow != -1;
}
if (!openAnimationInProgress) {
boolean currentVisible = writeButton.getTag() == null;
Expand Down

0 comments on commit 93394e3

Please sign in to comment.