diff --git a/mastodon/build.gradle b/mastodon/build.gradle index 8134c5b9..2b30ac87 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -10,7 +10,7 @@ android { applicationId "org.joinmastodon.android" minSdk 23 targetSdk 31 - versionCode 21 + versionCode 22 versionName "0.1" } diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java index b0bc9cc7..5a28b7c4 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/session/AccountSessionManager.java @@ -96,7 +96,7 @@ public class AccountSessionManager{ sessions.put(session.getID(), session); lastActiveAccountID=session.getID(); writeAccountsFile(); - maybeUpdateLocalInfo(); + updateInstanceEmojis(instance, instance.uri); if(PushSubscriptionManager.arePushNotificationsAvailable()){ session.getPushSubscriptionManager().registerAccountForPush(); } @@ -268,26 +268,30 @@ public class AccountSessionManager{ @Override public void onSuccess(Instance instance){ instances.put(domain, instance); - new GetCustomEmojis() - .setCallback(new Callback<>(){ - @Override - public void onSuccess(List result){ - InstanceInfoStorageWrapper emojis=new InstanceInfoStorageWrapper(); - emojis.lastUpdated=System.currentTimeMillis(); - emojis.emojis=result; - emojis.instance=instance; - customEmojis.put(domain, groupCustomEmojis(emojis)); - instancesLastUpdated.put(domain, emojis.lastUpdated); - MastodonAPIController.runInBackground(()->writeInstanceInfoFile(emojis, domain)); - E.post(new EmojiUpdatedEvent(domain)); - } + updateInstanceEmojis(instance, domain); + } - @Override - public void onError(ErrorResponse error){ + @Override + public void onError(ErrorResponse error){ - } - }) - .execNoAuth(domain); + } + }) + .execNoAuth(domain); + } + + private void updateInstanceEmojis(Instance instance, String domain){ + new GetCustomEmojis() + .setCallback(new Callback<>(){ + @Override + public void onSuccess(List result){ + InstanceInfoStorageWrapper emojis=new InstanceInfoStorageWrapper(); + emojis.lastUpdated=System.currentTimeMillis(); + emojis.emojis=result; + emojis.instance=instance; + customEmojis.put(domain, groupCustomEmojis(emojis)); + instancesLastUpdated.put(domain, emojis.lastUpdated); + MastodonAPIController.runInBackground(()->writeInstanceInfoFile(emojis, domain)); + E.post(new EmojiUpdatedEvent(domain)); } @Override diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java index f591d7c9..b91fd4f0 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/StatusDisplayItem.java @@ -107,7 +107,7 @@ public abstract class StatusDisplayItem{ if(statusForContent.poll!=null){ buildPollItems(parentID, fragment, statusForContent.poll, items); } - if(statusForContent.card!=null && statusForContent.mediaAttachments.isEmpty()){ + if(statusForContent.card!=null && statusForContent.mediaAttachments.isEmpty() && TextUtils.isEmpty(statusForContent.spoilerText)){ items.add(new LinkCardStatusDisplayItem(parentID, fragment, statusForContent)); } if(addFooter){