diff --git a/mastodon/src/main/java/org/joinmastodon/android/api/PushSubscriptionManager.java b/mastodon/src/main/java/org/joinmastodon/android/api/PushSubscriptionManager.java index f20be90b..19f9e39b 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/api/PushSubscriptionManager.java +++ b/mastodon/src/main/java/org/joinmastodon/android/api/PushSubscriptionManager.java @@ -121,10 +121,6 @@ public class PushSubscriptionManager{ return !TextUtils.isEmpty(deviceToken); } - public void registerAccountForPush(){ - registerAccountForPush(null); - } - public void registerAccountForPush(PushSubscription subscription){ if(TextUtils.isEmpty(deviceToken)) throw new IllegalStateException("No device push token available"); @@ -367,7 +363,7 @@ public class PushSubscriptionManager{ private static void registerAllAccountsForPush(boolean forceReRegister){ for(AccountSession session:AccountSessionManager.getInstance().getLoggedInAccounts()){ if(session.pushSubscription==null || forceReRegister) - session.getPushSubscriptionManager().registerAccountForPush(); + session.getPushSubscriptionManager().registerAccountForPush(session.pushSubscription); else if(session.needUpdatePushSettings) session.getPushSubscriptionManager().updatePushSettings(session.pushSubscription); } 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 fb136385..f3a05f9f 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 @@ -100,7 +100,7 @@ public class AccountSessionManager{ writeAccountsFile(); updateInstanceEmojis(instance, instance.uri); if(PushSubscriptionManager.arePushNotificationsAvailable()){ - session.getPushSubscriptionManager().registerAccountForPush(); + session.getPushSubscriptionManager().registerAccountForPush(null); } }