From 90765fdcabccda20ae19df364a69db9acde7f505 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BB=BB=E5=A4=A9=E5=A4=A9?=
<61044187+ruattd@users.noreply.github.com>
Date: Mon, 12 Feb 2024 21:29:17 +0800
Subject: [PATCH] feat: disable click command to send (#36)
---
.../org/telegram/ui/Components/ChatActivityEnterView.java | 5 +++++
.../nekogram/settings/NekoChatSettingsActivity.java | 1 +
.../src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt | 6 ++++++
TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml | 2 ++
TMessagesProj/src/main/res/values/strings_na.xml | 2 ++
5 files changed, 16 insertions(+)
diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java
index 5c89449b1a..080e942abe 100644
--- a/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java
+++ b/TMessagesProj/src/main/java/org/telegram/ui/Components/ChatActivityEnterView.java
@@ -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());
diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java
index 0e81d6ad4f..1620fb82cf 100644
--- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java
+++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java
@@ -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
diff --git a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
index 2aca58207c..73b6abd5d0 100644
--- a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
+++ b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt
@@ -518,6 +518,12 @@ object NaConfig {
ConfigItem.configTypeBool,
false
)
+ val disableClickCommandToSend =
+ addConfig(
+ "DisableClickCommandToSend",
+ ConfigItem.configTypeBool,
+ false
+ )
private fun addConfig(
k: String,
diff --git a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
index b2f7e03446..a1a9a1fb34 100644
--- a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
+++ b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml
@@ -120,4 +120,6 @@
要关注我们的功能介绍频道吗 ?
功能介绍频道
GIF 显示得更小
+ 禁用点击指令文本发送
+ 妈妈再也不用担心我会误触啦
diff --git a/TMessagesProj/src/main/res/values/strings_na.xml b/TMessagesProj/src/main/res/values/strings_na.xml
index bf2de15564..a47eb98dbe 100644
--- a/TMessagesProj/src/main/res/values/strings_na.xml
+++ b/TMessagesProj/src/main/res/values/strings_na.xml
@@ -120,4 +120,6 @@
Want to follow our features tips channel?
Features Tips Channel
Show Small Gif
+ Disable click command text to send
+ To prevent accidental touch