diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java index d8744ef9a..e70184cf4 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -937,6 +937,9 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr if(hasSpoiler){ charCount+=spoilerEdit.length(); } + if (localOnly && GlobalUserPreferences.accountsInGlitchMode.contains(accountID)) { + charCount -= GLITCH_LOCAL_ONLY_SUFFIX.length(); + } charCounter.setText(String.valueOf(charLimit-charCount)); trimmedCharCount=text.toString().trim().length(); updatePublishButtonState(); @@ -1854,7 +1857,10 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr Menu m=visibilityPopup.getMenu(); MenuItem localOnlyItem = visibilityPopup.getMenu().findItem(R.id.local_only); boolean prefsSaysSupported = GlobalUserPreferences.accountsWithLocalOnlySupport.contains(accountID); - if (localOnly || prefsSaysSupported) { + if (instance.pleroma != null) { + m.findItem(R.id.vis_local).setVisible(true); + } else if (localOnly || prefsSaysSupported) { + localOnlyItem.setVisible(true); localOnlyItem.setChecked(localOnly); Status status = editingStatus != null ? editingStatus : replyTo; if (!prefsSaysSupported) { @@ -1864,8 +1870,6 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr } GlobalUserPreferences.save(); } - } else { - localOnlyItem.setVisible(false); } UiUtils.enablePopupMenuIcons(getActivity(), visibilityPopup); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) m.setGroupDividerEnabled(true); @@ -1881,6 +1885,8 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr statusVisibility=StatusPrivacy.PRIVATE; }else if(id==R.id.vis_private){ statusVisibility=StatusPrivacy.DIRECT; + }else if(id==R.id.vis_local){ + statusVisibility=StatusPrivacy.LOCAL; } if (id == R.id.local_only) { localOnly = !item.isChecked(); diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java index ce976f7a9..b33aa4664 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/utils/UiUtils.java @@ -914,7 +914,8 @@ public class UiUtils{ public static boolean setExtraTextInfo(Context ctx, TextView extraText, StatusPrivacy visibility, boolean localOnly) { List extraParts = new ArrayList<>(); - if (localOnly) extraParts.add(ctx.getString(R.string.sk_inline_local_only)); + if (localOnly || (visibility != null && visibility.equals(StatusPrivacy.LOCAL))) + extraParts.add(ctx.getString(R.string.sk_inline_local_only)); if (visibility != null && visibility.equals(StatusPrivacy.DIRECT)) extraParts.add(ctx.getString(R.string.sk_inline_direct)); if (!extraParts.isEmpty()) { diff --git a/mastodon/src/main/res/menu/compose_visibility.xml b/mastodon/src/main/res/menu/compose_visibility.xml index 3f5c31fe5..3b6070dd4 100644 --- a/mastodon/src/main/res/menu/compose_visibility.xml +++ b/mastodon/src/main/res/menu/compose_visibility.xml @@ -3,10 +3,15 @@ +