Skip to content

Commit

Permalink
feat: disable click command to send (NextAlone#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruattd committed Feb 12, 2024
1 parent ed450bc commit 90765fd
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 0 deletions.
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>

0 comments on commit 90765fd

Please sign in to comment.