diff --git a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java index e3cde5dca..672727bed 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/ChatActivity.java @@ -13966,7 +13966,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not } boolean allowRepeat = currentUser != null || (currentChat != null && ChatObject.canSendMessages(currentChat)); - if (allowRepeat) { + if (allowRepeat && NekoConfig.showRepeat) { items.add(LocaleController.getString("Repeat", R.string.Repeat)); options.add(94); icons.add(R.drawable.msg_repeat); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoConfig.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoConfig.java index f711da353..05214acbc 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoConfig.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoConfig.java @@ -35,6 +35,7 @@ public class NekoConfig { public static boolean showDeleteDownloadedFile = true; public static boolean showMessageDetails = false; public static boolean showTranslate = true; + public static boolean showRepeat = true; public static boolean xmas = false; public static boolean newYear = false; @@ -75,6 +76,7 @@ public class NekoConfig { editor.putBoolean("showDeleteDownloadedFile", showDeleteDownloadedFile); editor.putBoolean("showMessageDetails", showMessageDetails); editor.putBoolean("showTranslate", showTranslate); + editor.putBoolean("showRepeat", showRepeat); editor.putBoolean("xmas", xmas); editor.putBoolean("newYear", newYear); editor.putBoolean("newYearEve", newYearEve); @@ -117,6 +119,7 @@ public class NekoConfig { showDeleteDownloadedFile = preferences.getBoolean("showDeleteDownloadedFile", true); showMessageDetails = preferences.getBoolean("showMessageDetails", false); showTranslate = preferences.getBoolean("showTranslate", true); + showRepeat = preferences.getBoolean("showRepeat", true); xmas = preferences.getBoolean("xmas", false); newYear = preferences.getBoolean("newYear", false); newYearEve = preferences.getBoolean("newYearEve", false); @@ -193,6 +196,14 @@ public class NekoConfig { editor.commit(); } + public static void toggleShowRepeat() { + showRepeat = !showRepeat; + SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); + SharedPreferences.Editor editor = preferences.edit(); + editor.putBoolean("showRepeat", showRepeat); + editor.commit(); + } + public static void toggleIPv6() { useIPv6 = !useIPv6; SharedPreferences preferences = ApplicationLoader.applicationContext.getSharedPreferences("nekoconfig", Activity.MODE_PRIVATE); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java index 571d0cd4e..75a89d6b7 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/NekoSettingsActivity.java @@ -595,7 +595,7 @@ public class NekoSettingsActivity extends BaseFragment { linearLayoutInviteContainer.setOrientation(LinearLayout.VERTICAL); linearLayout.addView(linearLayoutInviteContainer, LayoutHelper.createLinear(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT)); - int count = 9; + int count = 10; for (int a = 0; a < count; a++) { TextCheckCell textCell = new TextCheckCell(context); switch (a) { @@ -635,6 +635,10 @@ public class NekoSettingsActivity extends BaseFragment { textCell.setTextAndCheck(LocaleController.getString("Translate", R.string.Translate), NekoConfig.showTranslate, false); break; } + case 9: { + textCell.setTextAndCheck(LocaleController.getString("Repeat", R.string.Repeat), NekoConfig.showRepeat, false); + break; + } } textCell.setTag(a); textCell.setBackgroundDrawable(Theme.getSelectorDrawable(false)); @@ -687,6 +691,11 @@ public class NekoSettingsActivity extends BaseFragment { textCell.setChecked(NekoConfig.showTranslate); break; } + case 9: { + NekoConfig.toggleShowRepeat(); + textCell.setChecked(NekoConfig.showRepeat); + break; + } } }); }