diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java index f2ad32cab..335d00914 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/CacheController.java @@ -159,7 +159,7 @@ public class CacheController{ } } Instance instance=AccountSessionManager.getInstance().getInstanceInfo(accountSession.domain); - new GetNotifications(maxID, count, onlyPosts ? EnumSet.of(Notification.Type.STATUS) : onlyMentions ? EnumSet.of(Notification.Type.MENTION): EnumSet.allOf(Notification.Type.class), instance.isPleroma()) + new GetNotifications(maxID, count, onlyPosts ? EnumSet.of(Notification.Type.STATUS) : onlyMentions ? EnumSet.of(Notification.Type.MENTION): EnumSet.allOf(Notification.Type.class), instance.isAkkoma()) .setCallback(new Callback<>(){ @Override public void onSuccess(List result){ 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 c7054310e..e2a87895a 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ComposeFragment.java @@ -1084,7 +1084,7 @@ public class ComposeFragment extends MastodonToolbarFragment implements OnBackPr } req.status=text; req.localOnly=localOnly; - req.visibility=localOnly && instance.isPleroma() ? StatusPrivacy.LOCAL : statusVisibility; + req.visibility=localOnly && instance.isAkkoma() ? StatusPrivacy.LOCAL : statusVisibility; req.sensitive=sensitive; req.language=language; req.contentType=contentType; @@ -1899,7 +1899,7 @@ 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 (instance.isPleroma()) { + if (instance.isAkkoma()) { m.findItem(R.id.vis_local).setVisible(true); } else if (localOnly || prefsSaysSupported) { localOnlyItem.setVisible(true); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HasAccountID.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HasAccountID.java index 39915878b..67a3bbfac 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HasAccountID.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HasAccountID.java @@ -14,7 +14,7 @@ public interface HasAccountID { } default boolean isInstanceAkkoma() { - return getInstance().map(Instance::isPleroma).orElse(false); + return getInstance().map(Instance::isAkkoma).orElse(false); } default Optional getInstance() { diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java index 0de5cae19..96f4dec28 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/HomeFragment.java @@ -78,7 +78,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene accountID=getArguments().getString("account"); setTitle(R.string.sk_app_name); isPleroma = AccountSessionManager.getInstance().getAccount(accountID).getInstance() - .map(Instance::isPleroma) + .map(Instance::isAkkoma) .orElse(false); if(Build.VERSION.SDK_INT>=Build.VERSION_CODES.N) @@ -310,7 +310,7 @@ public class HomeFragment extends AppKitFragment implements OnBackPressedListene Optional instance = session.getInstance(); if (instance.isEmpty()) return; // avoiding incompatibility with akkoma - new GetNotifications(null, 1, EnumSet.allOf(Notification.Type.class), instance.get().isPleroma()) + new GetNotifications(null, 1, EnumSet.allOf(Notification.Type.class), instance.get().isAkkoma()) .setCallback(new Callback<>() { @Override public void onSuccess(List notifications) { diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java index 97611f916..176adcfe1 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/NotificationsListFragment.java @@ -163,8 +163,9 @@ public class NotificationsListFragment extends BaseStatusListFragment{ PopupMenu popupMenu=new PopupMenu(getActivity(), b, Gravity.CENTER_HORIZONTAL); popupMenu.inflate(R.menu.reply_visibility); @@ -374,7 +374,7 @@ public class SettingsFragment extends MastodonToolbarFragment implements Provide glitchModeItem.enabled = i.checked; if (i.checked) { GlobalUserPreferences.accountsWithLocalOnlySupport.add(accountID); - if (!instance.map(Instance::isPleroma).orElse(false)) { + if (!isInstanceAkkoma()) { GlobalUserPreferences.accountsInGlitchMode.add(accountID); } } else { diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java index f51457dc4..0b6de10e8 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/ThreadFragment.java @@ -74,9 +74,7 @@ public class ThreadFragment extends StatusListFragment implements ProvidesAssist data.add(mainStatus); onAppendItems(Collections.singletonList(mainStatus)); } - AccountSession account=AccountSessionManager.getInstance().getAccount(accountID); - Instance instance=AccountSessionManager.getInstance().getInstanceInfo(account.domain); - if(instance.isPleroma()){ + if(isInstanceAkkoma()){ List threadIds=new ArrayList<>(); threadIds.add(mainStatus.id); for(Status s:result.descendants){ diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java b/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java index 5ceaeb72e..d89cc8232 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/Instance.java @@ -143,7 +143,7 @@ public class Instance extends BaseModel{ return ci; } - public boolean isPleroma() { + public boolean isAkkoma() { return pleroma != null; } diff --git a/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java b/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java index 210e649d1..313b2d8d2 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java +++ b/mastodon/src/main/java/org/joinmastodon/android/model/TimelineDefinition.java @@ -259,13 +259,13 @@ public class TimelineDefinition { public boolean isCompatible(AccountSession session) { // still enabling the bubble timeline for all pleroma/akkoma instances since i know of // at least one instance that supports it, but doesn't list "bubble_timeline" - return session.getInstance().map(Instance::isPleroma).orElse(false); + return session.getInstance().map(Instance::isAkkoma).orElse(false); } @Override public boolean wantsDefault(AccountSession session) { return session.getInstance() - .map(i -> i.isPleroma() && i.pleroma.metadata.features.contains("bubble_timeline")) + .map(i -> i.isAkkoma() && i.pleroma.metadata.features.contains("bubble_timeline")) .orElse(false); } };