Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: disable click command to send #36

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9178,6 +9178,11 @@ public void setCommand(MessageObject messageObject, String command, boolean long
openKeyboard();
}
} else {
// Na: DisableClickCommandToSend
if (NaConfig.INSTANCE.getDisableClickCommandToSend().Bool()) {
return;
}

if (slowModeTimer > 0 && !isInScheduleMode()) {
if (delegate != null) {
delegate.onUpdateSlowModeButton(slowModeButton, true, slowModeButton.getText());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ public class NekoChatSettingsActivity extends BaseNekoXSettingsActivity implemen
private final AbstractConfigCell hideBotButtonInInputFieldRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getHideBotButtonInInputField()));
private final AbstractConfigCell doNotUnarchiveBySwipeRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDoNotUnarchiveBySwipe()));
private final AbstractConfigCell disableMarkdownRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableMarkdown()));
private final AbstractConfigCell disableClickCommandToSendRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableClickCommandToSend(), LocaleController.getString(R.string.DisableClickCommandToSendHint)));
private final AbstractConfigCell dividerInteractions = cellGroup.appendCell(new ConfigCellDivider());

// Sticker
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,12 @@ object NaConfig {
ConfigItem.configTypeBool,
false
)
val disableClickCommandToSend =
addConfig(
"DisableClickCommandToSend",
ConfigItem.configTypeBool,
false
)

private fun addConfig(
k: String,
Expand Down
2 changes: 2 additions & 0 deletions TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,6 @@
<string name="TipsInfo">要关注我们的功能介绍频道吗 ?</string>
<string name="TipsChannel">功能介绍频道</string>
<string name="ShowSmallGIF">GIF 显示得更小</string>
<string name="DisableClickCommandToSend">禁用点击指令文本发送</string>
<string name="DisableClickCommandToSendHint">妈妈再也不用担心我会误触啦</string>
</resources>
2 changes: 2 additions & 0 deletions TMessagesProj/src/main/res/values/strings_na.xml
Original file line number Diff line number Diff line change
Expand Up @@ -120,4 +120,6 @@
<string name="TipsInfo">Want to follow our features tips channel?</string>
<string name="TipsChannel">Features Tips Channel</string>
<string name="ShowSmallGIF">Show Small Gif</string>
<string name="DisableClickCommandToSend">Disable click command text to send</string>
<string name="DisableClickCommandToSendHint">To prevent accidental touch</string>
</resources>