mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 09:17:44 +00:00
Consider unregister successfull on 401 from RP server.
Fixes #4362 // FREEBIE
This commit is contained in:
parent
004a87eba9
commit
58406d6b37
@ -21,6 +21,7 @@ import com.google.android.gms.gcm.GoogleCloudMessaging;
|
|||||||
|
|
||||||
import org.thoughtcrime.redphone.signaling.RedPhoneAccountManager;
|
import org.thoughtcrime.redphone.signaling.RedPhoneAccountManager;
|
||||||
import org.thoughtcrime.redphone.signaling.RedPhoneTrustStore;
|
import org.thoughtcrime.redphone.signaling.RedPhoneTrustStore;
|
||||||
|
import org.thoughtcrime.redphone.signaling.UnauthorizedException;
|
||||||
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
|
import org.thoughtcrime.securesms.ApplicationPreferencesActivity;
|
||||||
import org.thoughtcrime.securesms.BuildConfig;
|
import org.thoughtcrime.securesms.BuildConfig;
|
||||||
import org.thoughtcrime.securesms.LogSubmitActivity;
|
import org.thoughtcrime.securesms.LogSubmitActivity;
|
||||||
@ -184,13 +185,20 @@ public class AdvancedPreferenceFragment extends PreferenceFragment {
|
|||||||
TextSecurePreferences.getLocalNumber(context),
|
TextSecurePreferences.getLocalNumber(context),
|
||||||
TextSecurePreferences.getPushServerPassword(context));
|
TextSecurePreferences.getPushServerPassword(context));
|
||||||
|
|
||||||
accountManager.setGcmId(Optional.<String>absent());
|
try {
|
||||||
redPhoneAccountManager.setGcmId(Optional.<String>absent());
|
accountManager.setGcmId(Optional.<String>absent());
|
||||||
|
} catch (AuthorizationFailedException e) {
|
||||||
|
Log.w(TAG, e);
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
redPhoneAccountManager.setGcmId(Optional.<String>absent());
|
||||||
|
} catch (UnauthorizedException e) {
|
||||||
|
Log.w(TAG, e);
|
||||||
|
}
|
||||||
|
|
||||||
GoogleCloudMessaging.getInstance(context).unregister();
|
GoogleCloudMessaging.getInstance(context).unregister();
|
||||||
|
|
||||||
return SUCCESS;
|
|
||||||
} catch (AuthorizationFailedException afe) {
|
|
||||||
Log.w(TAG, afe);
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
} catch (IOException ioe) {
|
} catch (IOException ioe) {
|
||||||
Log.w(TAG, ioe);
|
Log.w(TAG, ioe);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user