diff --git a/mastodon/build.gradle b/mastodon/build.gradle index a51a7a98..ecf599b8 100644 --- a/mastodon/build.gradle +++ b/mastodon/build.gradle @@ -13,8 +13,8 @@ android { applicationId "org.joinmastodon.android" minSdk 23 targetSdk 34 - versionCode 131 - versionName "2.9.2" + versionCode 132 + versionName "2.9.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } 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 d9a8e066..729276d7 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 @@ -125,7 +125,7 @@ public class AccountSessionManager{ public void addAccount(Instance instance, Token token, Account self, Application app, AccountActivationInfo activationInfo){ instances.put(instance.getDomain(), instance); - runOnDbThread(db->insertInstanceIntoDatabase(db, instance.getDomain(), instance, List.of(), 0)); + runOnDbThread(db->insertInstanceIntoDatabase(db, instance.getDomain(), instance, null, 0)); AccountSession session=new AccountSession(token, self, app, instance.getDomain(), activationInfo==null, activationInfo); sessions.put(session.getID(), session); lastActiveAccountID=session.getID(); @@ -351,7 +351,7 @@ public class AccountSessionManager{ @Override public void onSuccess(Instance instance){ instances.put(domain, instance); - runOnDbThread(db->insertInstanceIntoDatabase(db, domain, instance, List.of(), 0)); + runOnDbThread(db->insertInstanceIntoDatabase(db, domain, instance, null, 0)); updateInstanceEmojis(instance, domain); } @@ -628,7 +628,8 @@ public class AccountSessionManager{ ContentValues values=new ContentValues(); values.put("domain", domain); values.put("instance_obj", MastodonAPIController.gson.toJson(instance)); - values.put("emojis", MastodonAPIController.gson.toJson(emojis)); + if(emojis!=null) + values.put("emojis", MastodonAPIController.gson.toJson(emojis)); values.put("last_updated", lastUpdated); values.put("version", instance.getVersion()); db.insertWithOnConflict("instances", null, values, SQLiteDatabase.CONFLICT_REPLACE); diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java index 6b4c1ef9..d8e819b0 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/onboarding/AccountActivationFragment.java @@ -24,6 +24,7 @@ import org.joinmastodon.android.api.session.AccountSession; import org.joinmastodon.android.api.session.AccountSessionManager; import org.joinmastodon.android.fragments.settings.SettingsMainFragment; import org.joinmastodon.android.model.Account; +import org.joinmastodon.android.model.Instance; import org.joinmastodon.android.ui.sheets.AccountSwitcherSheet; import org.joinmastodon.android.ui.utils.UiUtils; @@ -175,8 +176,9 @@ public class AccountActivationFragment extends ToolbarFragment{ currentRequest=null; AccountSessionManager mgr=AccountSessionManager.getInstance(); AccountSession session=mgr.getAccount(accountID); - mgr.addAccount(mgr.getInstanceInfo(session.domain), session.token, result, session.app, null); + Instance instance=mgr.getInstanceInfo(session.domain); mgr.removeAccount(accountID); + mgr.addAccount(instance, session.token, result, session.app, null); String newID=mgr.getLastActiveAccountID(); accountID=newID; if((session.self.avatar!=null || session.self.displayName!=null) && !getArguments().getBoolean("debug")){