mirror of
https://github.com/MGislv/NekoX.git
synced 2024-07-04 11:13:36 +00:00
Update dev config
This commit is contained in:
parent
e7b9b95371
commit
e7d45120ba
|
@ -2851,6 +2851,11 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||
}
|
||||
|
||||
public boolean isChatNoForwards(TLRPC.Chat chat) {
|
||||
return !NekoXConfig.developerMode && isChatNoForwardsOffical(chat);
|
||||
}
|
||||
|
||||
//Offical
|
||||
public boolean isChatNoForwardsOffical(TLRPC.Chat chat) {
|
||||
if (chat == null) return false;
|
||||
if (chat.migrated_to != null) {
|
||||
TLRPC.Chat migratedTo = getChat(chat.migrated_to.channel_id);
|
||||
|
|
|
@ -27776,6 +27776,14 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
|
||||
private void repeatMessage(boolean isLongClick) {
|
||||
// TODO remove about selectedObject.replyMessageObject
|
||||
boolean isNoForwards = getMessagesController().isChatNoForwardsOffical(currentChat);
|
||||
|
||||
if (checkSlowMode(chatActivityEnterView.getSendButton())) {
|
||||
return;
|
||||
}
|
||||
|
||||
// copy
|
||||
if (selectedObject != null && (isLongClick || isThreadChat()) && selectedObject.replyMessageObject != null) {
|
||||
// If selected message contains `replyTo`:
|
||||
// When longClick it will reply to the `replyMessage` of selectedMessage
|
||||
|
@ -27799,9 +27807,6 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
}
|
||||
return;
|
||||
}
|
||||
if (checkSlowMode(chatActivityEnterView.getSendButton())) {
|
||||
return;
|
||||
}
|
||||
|
||||
final ArrayList<MessageObject> messages = new ArrayList<>();
|
||||
if (selectedObject != null)
|
||||
|
@ -27812,6 +27817,7 @@ public class ChatActivity extends BaseFragment implements NotificationCenter.Not
|
|||
messages.add(selectedMessagesIds[0].get(selectedMessagesIds[0].keyAt(k)));
|
||||
}
|
||||
|
||||
// forward
|
||||
if (!NekomuraConfig.repeatConfirm.Bool()) {
|
||||
forwardMessages(messages, false, false, true, 0);
|
||||
return;
|
||||
|
|
|
@ -1506,10 +1506,13 @@ public class SharedMediaLayout extends FrameLayout implements NotificationCenter
|
|||
|
||||
boolean noforwards = profileActivity.getMessagesController().isChatNoForwards(-dialog_id);
|
||||
forwardItem.setAlpha(noforwards ? 0.5f : 1f);
|
||||
forwardNoQuoteItem.setAlpha(noforwards ? 0.5f : 1f);
|
||||
if (noforwards) {
|
||||
if (forwardItem.getBackground() != null) forwardItem.setBackground(null);
|
||||
if (forwardNoQuoteItem.getBackground() != null) forwardNoQuoteItem.setBackground(null);
|
||||
} else if (forwardItem.getBackground() == null) {
|
||||
forwardItem.setBackground(Theme.createSelectorDrawable(Theme.getColor(Theme.key_actionBarActionModeDefaultSelector), 5));
|
||||
forwardNoQuoteItem.setBackground(Theme.createSelectorDrawable(Theme.getColor(Theme.key_actionBarActionModeDefaultSelector), 5));
|
||||
}
|
||||
}
|
||||
deleteItem = new ActionBarMenuItem(context, null, Theme.getColor(Theme.key_actionBarActionModeDefaultSelector), Theme.getColor(Theme.key_windowBackgroundWhiteGrayText2), false);
|
||||
|
|
|
@ -2947,8 +2947,6 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
} else if (position == setAvatarRow) {
|
||||
} else if (position == versionRow) {
|
||||
TextInfoPrivacyCell cell = (TextInfoPrivacyCell) view;
|
||||
if (BuildVars.LOGS_ENABLED) pressCount++;
|
||||
if (pressCount == 8) NekoXConfig.developerModeEntrance = true;
|
||||
|
||||
BottomBuilder builder = new BottomBuilder(getParentActivity());
|
||||
String message = cell.getTextView().getText().toString();
|
||||
|
@ -3022,7 +3020,7 @@ public class ProfileActivity extends BaseFragment implements NotificationCenter.
|
|||
});
|
||||
}
|
||||
|
||||
if (NekoXConfig.developerModeEntrance || NekoXConfig.developerMode || ArrayUtil.contains(NekoXConfig.developers, getUserConfig().clientUserId)) {
|
||||
if (NekomuraConfig.showCensoredFeatures(getUserConfig().clientUserId)) {
|
||||
builder.addItem(LocaleController.getString("DeveloperSettings", R.string.DeveloperSettings), R.drawable.baseline_developer_mode_24, (it) -> {
|
||||
BottomBuilder devBuilder = new BottomBuilder(ProfileActivity.this.getParentActivity());
|
||||
devBuilder.addTitle(LocaleController.getString("DevModeTitle", R.string.DevModeTitle), LocaleController.getString("DevModeNotice", R.string.DevModeNotice));
|
||||
|
|
|
@ -29,7 +29,6 @@ public class NekoXConfig {
|
|||
|
||||
public static SharedPreferences preferences = NitritesKt.openMainSharedPreference("nekox_config");
|
||||
|
||||
public static boolean developerModeEntrance;
|
||||
public static boolean developerMode = preferences.getBoolean("developer_mode", false);
|
||||
|
||||
public static boolean disableFlagSecure = preferences.getBoolean("disable_flag_secure", false);
|
||||
|
|
|
@ -527,7 +527,7 @@ public class NekomuraConfig {
|
|||
}
|
||||
|
||||
public static boolean showCensoredFeatures(long myId) {
|
||||
return NekoXConfig.developerMode || NekoXConfig.customApi > 0 || Arrays.stream(NekoXConfig.developers).anyMatch(id -> id == myId);
|
||||
return NekoXConfig.developerMode || Arrays.stream(NekoXConfig.developers).anyMatch(id -> id == myId);
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user