Skip to content

Commit

Permalink
feat: Disable Channel Mute Button
Browse files Browse the repository at this point in the history
Co-author: xtaodada <xtao@xtaolink.cn>
  • Loading branch information
NextAlone committed Apr 13, 2024
1 parent 6f76e11 commit 42c3043
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -24675,6 +24675,10 @@ private void updateBottomOverlay() {
bottomOverlayChatText.setText(LocaleController.getString("ChannelUnmute", R.string.ChannelUnmute), true);
bottomOverlayChatText.setEnabled(true);
}
if (Config.disableChannelMuteButton) {
bottomOverlayChatText.setText("", false);
bottomOverlayChatText.setEnabled(false);
}
showBottomOverlayProgress(false, bottomOverlayProgress.getTag() != null);
} else if (forumTopic != null && forumTopic.closed) {
if (!ChatObject.canManageTopic(currentAccount, currentChat, forumTopic)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ public class ChatSettingActivity extends BaseActivity {
private int filterZalgoRow;
private int hideKeyboardWhenScrollingRow;
private int searchInPlaceRow;
private int disableChannelMuteButtonRow;
private int chat2Row;

private int markdownRow;
Expand Down Expand Up @@ -448,6 +449,11 @@ protected void onItemClick(View view, int position, float x, float y) {
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(Config.searchInPlace);
}
} else if (position == disableChannelMuteButtonRow) {
Config.toggleDisableChannelMuteButton();
if (view instanceof TextCheckCell) {
((TextCheckCell) view).setChecked(Config.disableChannelMuteButton);
}
}
}

Expand Down Expand Up @@ -513,6 +519,7 @@ protected void updateRows() {
filterZalgoRow = addRow("filterZalgo");
hideKeyboardWhenScrollingRow = addRow("hideKeyboardWhenScrolling");
searchInPlaceRow = addRow("searchInPlace");
disableChannelMuteButtonRow = addRow("disableChannelMuteButton");
chat2Row = addRow();
markdownRow = addRow();
markdownDisableRow = addRow("markdownDisabled");
Expand Down Expand Up @@ -685,6 +692,8 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, boole
textCell.setTextAndCheck(LocaleController.getString("hideKeyboardWhenScrolling", R.string.hideKeyboardWhenScrolling), Config.hideKeyboardWhenScrolling, true);
} else if (position == searchInPlaceRow) {
textCell.setTextAndCheck(LocaleController.getString("searchInPlace", R.string.searchInPlace), Config.searchInPlace, true);
} else if (position == disableChannelMuteButtonRow) {
textCell.setTextAndCheck(LocaleController.getString("disableChannelMuteButton", R.string.disableChannelMuteButton), Config.disableChannelMuteButton, true);
}
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ object Defines {
@BooleanConfig const val searchInPlace = "searchInPlace"
@IntConfig(100) const val gifSize = "gifSize"
@BooleanConfig const val hideDialogsFloatingButton = "hideDialogsFloatingButton"
@BooleanConfig const val disableChannelMuteButton = "disableChannelMuteButton"

// Drawer List
@BooleanConfig(true) const val showNewGroup = "showNewGroup"
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values-zh/strings_nullgram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@
<string name="gifSize">GIF 大小</string>
<string name="block">屏蔽</string>
<string name="hideDialogsFloatingButton">禁用主页浮动按钮</string>
<string name="disableChannelMuteButton">禁用频道静音按钮</string>

<string name="Quote">引用</string>
<string name="QuoteTo">引用到...</string>
Expand Down
1 change: 1 addition & 0 deletions TMessagesProj/src/main/res/values/strings_nullgram.xml
Original file line number Diff line number Diff line change
Expand Up @@ -376,4 +376,5 @@
<string name="gifSize">GIF size</string>
<string name="block">Block</string>
<string name="hideDialogsFloatingButton">Hide dialogs floating button</string>
<string name="disableChannelMuteButton">Disable channel mute button</string>
</resources>

0 comments on commit 42c3043

Please sign in to comment.