From 246e4823ad63aaaa6c273950aca21961d6bc8085 Mon Sep 17 00:00:00 2001 From: luvletter2333 Date: Wed, 8 Dec 2021 22:27:48 +0800 Subject: [PATCH] fixes --- .../main/java/org/telegram/ui/LoginActivity.java | 14 +++++++------- .../settings/NekoChatSettingsActivity.java | 4 ++++ .../main/java/tw/nekomimi/nkmr/NekomuraConfig.java | 3 ++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java index b821cfac1..64cd98cc8 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/LoginActivity.java @@ -303,7 +303,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No @Override public View createView(Context context) { - actionBar.setTitle(LocaleController.getString("NekogramWithEmoji", R.string.NekoX)); + actionBar.setTitle(LocaleController.getString("NekoX", R.string.NekoX)); actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() { @Override public void onItemClick(int id) { @@ -1311,7 +1311,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No return; } AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setTitle(LocaleController.getString("NekogramWithEmoji", R.string.NekoX)); + builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX)); builder.setMessage(LocaleController.getString("StopLoading", R.string.StopLoading)); builder.setPositiveButton(LocaleController.getString("WaitMore", R.string.WaitMore), null); builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> { @@ -2181,10 +2181,10 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No return; } if (countryState == 1) { - needShowAlert(LocaleController.getString("NekogramWithEmoji", R.string.NekoX), LocaleController.getString("ChooseCountry", R.string.ChooseCountry)); + needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("ChooseCountry", R.string.ChooseCountry)); return; } else if (countryState == 2 && !BuildVars.DEBUG_VERSION) { - needShowAlert(LocaleController.getString("NekogramWithEmoji", R.string.NekoX), LocaleController.getString("WrongCountry", R.string.WrongCountry)); + needShowAlert(LocaleController.getString("NekoX", R.string.NekoX), LocaleController.getString("WrongCountry", R.string.WrongCountry)); return; } if (codeField.length() == 0) { @@ -2211,7 +2211,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No if (PhoneNumberUtils.compare(phone, userPhone) && ConnectionsManager.native_isTestBackend(currentAccount) == ConnectionsManager.native_isTestBackend(a)) { final int num = a; AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setTitle(LocaleController.getString("NekogramWithEmoji", R.string.NekoX)); + builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX)); builder.setMessage(LocaleController.getString("AccountAlreadyLoggedIn", R.string.AccountAlreadyLoggedIn)); builder.setPositiveButton(LocaleController.getString("AccountSwitch", R.string.AccountSwitch), (dialog, which) -> { if (UserConfig.selectedAccount != num) { @@ -3210,7 +3210,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No public boolean onBackPressed(boolean force) { if (!force) { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setTitle(LocaleController.getString("NekogramWithEmoji", R.string.NekoX)); + builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX)); builder.setMessage(LocaleController.getString("StopVerification", R.string.StopVerification)); builder.setPositiveButton(LocaleController.getString("Continue", R.string.Continue), null); builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> { @@ -4697,7 +4697,7 @@ public class LoginActivity extends BaseFragment implements NotificationCenter.No public boolean onBackPressed(boolean force) { if (!force) { AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity()); - builder.setTitle(LocaleController.getString("NekogramWithEmoji", R.string.NekoX)); + builder.setTitle(LocaleController.getString("NekoX", R.string.NekoX)); builder.setMessage(LocaleController.getString("AreYouSureRegistration", R.string.AreYouSureRegistration)); builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> { onBackPressed(true); 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 bc314a595..054d6c8d4 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java @@ -169,6 +169,10 @@ public class NekoChatSettingsActivity extends BaseFragment implements Notificati if (!showCensoredFeatures) { cellGroup.rows.remove(disableChatActionRow); cellGroup.rows.remove(disableChoosingStickerRow); + cellGroup.rows.remove(ignoreBlockedRow); + NekomuraConfig.disableChatAction.setConfigBool(false); + NekomuraConfig.disableChoosingSticker.setConfigBool(false); + NekomuraConfig.ignoreBlocked.setConfigBool(false); } listAdapter = new ListAdapter(context); diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nkmr/NekomuraConfig.java b/TMessagesProj/src/main/java/tw/nekomimi/nkmr/NekomuraConfig.java index ad203ea58..eaaa4788a 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nkmr/NekomuraConfig.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nkmr/NekomuraConfig.java @@ -5,6 +5,7 @@ import android.app.Activity; import android.content.Context; import android.content.SharedPreferences; +import cn.hutool.core.util.ArrayUtil; import org.telegram.messenger.ApplicationLoader; import org.telegram.messenger.BuildVars; import org.telegram.messenger.FileLog; @@ -527,7 +528,7 @@ public class NekomuraConfig { } public static boolean showCensoredFeatures(long myId) { - return NekoXConfig.developerMode || Arrays.stream(NekoXConfig.developers).anyMatch(id -> id == myId); + return NekoXConfig.developerMode || NekoXConfig.customApi > 0 || ArrayUtil.contains(NekoXConfig.developers, myId); } } \ No newline at end of file