diff --git a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java index ee53709a63..040bb43700 100644 --- a/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java +++ b/TMessagesProj/src/main/java/org/telegram/messenger/MessagesController.java @@ -18535,6 +18535,7 @@ public StoriesController getStoriesController() { } public boolean storiesEnabled() { + if (NaConfig.INSTANCE.getDisableStories().Bool()) return false; switch (storiesPosting) { case "premium": return getUserConfig().isPremium(); diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index a73d716566..bf6652e32c 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -8049,7 +8049,7 @@ private void updateFloatingButtonOffset() { } } - public boolean storiesEnabled = true; + public boolean storiesEnabled = !NaConfig.INSTANCE.getDisableStories().Bool(); private void updateStoriesPosting() { final boolean storiesEnabled = getMessagesController().storiesEnabled(); if (this.storiesEnabled != storiesEnabled) { diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesController.java b/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesController.java index ae830706e0..70a6193fbd 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesController.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesController.java @@ -64,6 +64,8 @@ import java.util.SortedSet; import java.util.TreeSet; +import xyz.nextalone.nagram.NaConfig; + public class StoriesController { public final static int STATE_READ = 0; @@ -187,11 +189,13 @@ public DraftsController getDraftsController() { } public boolean hasStories(long dialogId) { + if (NaConfig.INSTANCE.getDisableStories().Bool()) return false; TLRPC.TL_userStories stories = allStoriesMap.get(dialogId); return stories != null && !stories.stories.isEmpty(); } public boolean hasStories() { + if (NaConfig.INSTANCE.getDisableStories().Bool()) return false; return (dialogListStories != null && dialogListStories.size() > 0) || hasSelfStories(); } @@ -892,6 +896,7 @@ public boolean markStoryAsRead(TLRPC.TL_userStories userStories, TLRPC.StoryItem TLRPC.TL_stories_readStories req = new TLRPC.TL_stories_readStories(); req.user_id = MessagesController.getInstance(currentAccount).getInputUser(dialogId); req.max_id = storyItem.id; + if (NaConfig.INSTANCE.getDisableSendReadStories().Bool()) return true; ConnectionsManager.getInstance(currentAccount).sendRequest(req, (response, error) -> {}); return true; } diff --git a/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesUtilities.java b/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesUtilities.java index dc39fb335f..71d13cef25 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesUtilities.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/Stories/StoriesUtilities.java @@ -46,6 +46,8 @@ import java.util.Collections; +import xyz.nextalone.nagram.NaConfig; + public class StoriesUtilities { private final static int ANIMATION_SEGMENT_COUNT = 16; 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 5b45f942ca..81bd18be30 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/settings/NekoChatSettingsActivity.java @@ -180,6 +180,12 @@ public class NekoChatSettingsActivity extends BaseNekoXSettingsActivity implemen private final AbstractConfigCell repeatConfirmRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.repeatConfirm)); private final AbstractConfigCell dividerConfirms = cellGroup.appendCell(new ConfigCellDivider()); + // Story + private final AbstractConfigCell headerStory = cellGroup.appendCell(new ConfigCellHeader(LocaleController.getString("Story"))); + private final AbstractConfigCell disableStoriesRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableStories())); + private final AbstractConfigCell disableSendReadStoriesRow = cellGroup.appendCell(new ConfigCellTextCheck(NaConfig.INSTANCE.getDisableSendReadStories())); + private final AbstractConfigCell dividerStory = cellGroup.appendCell(new ConfigCellDivider()); + private final AbstractConfigCell ignoreBlockedRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.ignoreBlocked, LocaleController.getString("IgnoreBlockedAbout"))); private final AbstractConfigCell disableChatActionRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableChatAction)); private final AbstractConfigCell disableChoosingStickerRow = cellGroup.appendCell(new ConfigCellTextCheck(NekoConfig.disableChoosingSticker)); diff --git a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt index b476436edd..c117ab606c 100644 --- a/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt +++ b/TMessagesProj/src/main/kotlin/xyz/nextalone/nagram/NaConfig.kt @@ -424,6 +424,18 @@ object NaConfig { ConfigItem.configTypeBool, false ) + val disableStories = + addConfig( + "DisableStories", + ConfigItem.configTypeBool, + false + ) + val disableSendReadStories = + addConfig( + "DisableSendReadStories", + 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 ba1d900cc1..14ba17586a 100644 --- a/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml +++ b/TMessagesProj/src/main/res/values-zh-rCN/strings_na.xml @@ -86,4 +86,6 @@ 禁用分享我的手机号码 默认删除菜单 禁用修改手机号码的建议 + 禁用动态功能 + 偷偷看动态 diff --git a/TMessagesProj/src/main/res/values/strings_na.xml b/TMessagesProj/src/main/res/values/strings_na.xml index bce15d6644..fee8f8f309 100644 --- a/TMessagesProj/src/main/res/values/strings_na.xml +++ b/TMessagesProj/src/main/res/values/strings_na.xml @@ -89,4 +89,6 @@ Do not share my phone number Default Delete Menu Disable Profile Settings Suggestion + Disable Stories + Disable Send Read Stories