Skip to content

Commit b86ae93

Browse files
23rdet-ness
authored andcommitted
Added new option to hide archived stories.
1 parent ef7daaf commit b86ae93

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12965,7 +12965,8 @@ public void updateStoriesVisibility(boolean animated) {
1296512965
boolean onlySelfStories = !isArchive() && getStoriesController().hasOnlySelfStories();
1296612966
boolean newVisibility;
1296712967
if (isArchive()) {
12968-
newVisibility = !getStoriesController().getHiddenList().isEmpty();
12968+
boolean hideStoriesInArchive = MessagesController.getGlobalMainSettings().getBoolean("hideStoriesInArchive", false);
12969+
newVisibility = !hideStoriesInArchive && !getStoriesController().getHiddenList().isEmpty();
1296912970
} else {
1297012971
newVisibility = !onlySelfStories && getStoriesController().hasStories();
1297112972
onlySelfStories = getStoriesController().hasOnlySelfStories();

TMessagesProj/src/main/java/org/telegram/ui/ForkSettingsActivity.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ public void invalidate() {
177177
private int hideFloatingButton;
178178
private int chooseUnifiedPush;
179179
// end YATGram
180+
private int hideStoriesInArchiveRow;
180181

181182
private int stickerSizeRow;
182183

@@ -228,6 +229,7 @@ public boolean onFragmentCreate() {
228229
syncPinsRow = rowCount++;
229230
unmutedOnTopRow = rowCount++;
230231
openArchiveOnPull = rowCount++;
232+
hideStoriesInArchiveRow = rowCount++;
231233
disableThumbsInDialogList = rowCount++;
232234
disableGlobalSearch = rowCount++;
233235
customTitleRow = rowCount++;
@@ -415,6 +417,8 @@ public boolean supportsPredictiveItemAnimations() {
415417
toggleGlobalMainSetting("mentionByName", view, false);
416418
} else if (position == openArchiveOnPull) {
417419
toggleGlobalMainSetting("openArchiveOnPull", view, false);
420+
} else if (position == hideStoriesInArchiveRow) {
421+
toggleGlobalMainSetting("hideStoriesInArchive", view, false);
418422
} else if (position == disableFlipPhotos) {
419423
toggleGlobalMainSetting("disableFlipPhotos", view, false);
420424
} else if (position == formatWithSeconds) {
@@ -592,6 +596,9 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
592596
} else if (position == openArchiveOnPull) {
593597
String t = LocaleController.getString("OpenArchiveOnPull", R.string.OpenArchiveOnPull);
594598
textCell.setTextAndCheck(t, preferences.getBoolean("openArchiveOnPull", true), false);
599+
} else if (position == hideStoriesInArchiveRow) {
600+
String t = LocaleController.getString("HideStoriesInArchive", R.string.HideStoriesInArchive);
601+
textCell.setTextAndCheck(t, preferences.getBoolean("hideStoriesInArchive", false), false);
595602
} else if (position == disableFlipPhotos) {
596603
String t = LocaleController.getString("DisableFlipPhotos", R.string.DisableFlipPhotos);
597604
textCell.setTextAndCheck(t, preferences.getBoolean("disableFlipPhotos", false), false);
@@ -659,6 +666,7 @@ public boolean isEnabled(RecyclerView.ViewHolder holder) {
659666
|| position == replaceForward
660667
|| position == mentionByName
661668
|| position == openArchiveOnPull
669+
|| position == hideStoriesInArchiveRow
662670
|| position == disableFlipPhotos
663671
|| position == formatWithSeconds
664672
|| position == disableThumbsInDialogList
@@ -734,6 +742,7 @@ public int getItemViewType(int position) {
734742
|| position == replaceForward
735743
|| position == mentionByName
736744
|| position == openArchiveOnPull
745+
|| position == hideStoriesInArchiveRow
737746
|| position == disableFlipPhotos
738747
|| position == formatWithSeconds
739748
|| position == disableThumbsInDialogList

TMessagesProj/src/main/res/values/strings.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10260,4 +10260,7 @@
1026010260
<string name="BotCopyUrl">Copy every clicked link</string>
1026110261
<string name="DisableDefaultInAppBrowser">Open links in system browser</string>
1026210262
<string name="SmsOnlyOfficialWarning">Note: SMS verification is limited to ONLY official mobile apps</string>
10263-
</resources>
10263+
<string name="ThirdParty">Third-party</string>
10264+
<string name="EnableLastSeenDots">Enable colored last seen dots</string>
10265+
<string name="HideStoriesInArchive">Hide Stories in Archive</string>
10266+
</resources>

0 commit comments

Comments
 (0)