mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 20:15:21 +00:00
update local session id and stop polling if local session id has changed
This commit is contained in:
parent
106c22d9d2
commit
6fcc26cc22
@ -484,9 +484,12 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setUpPollingIfNeeded() {
|
private void setUpPollingIfNeeded() {
|
||||||
if (lokiPoller != null) return;
|
|
||||||
String userPublicKey = TextSecurePreferences.getLocalNumber(this);
|
String userPublicKey = TextSecurePreferences.getLocalNumber(this);
|
||||||
if (userPublicKey == null) return;
|
if (userPublicKey == null) return;
|
||||||
|
if (lokiPoller != null) {
|
||||||
|
lokiPoller.updateUserHexEncodedPublicKey(userPublicKey);
|
||||||
|
return;
|
||||||
|
}
|
||||||
LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this);
|
LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this);
|
||||||
Context context = this;
|
Context context = this;
|
||||||
LokiSwarmAPI.Companion.configureIfNeeded(apiDB);
|
LokiSwarmAPI.Companion.configureIfNeeded(apiDB);
|
||||||
@ -504,6 +507,10 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
|||||||
if (lokiPoller != null) { lokiPoller.startIfNeeded(); }
|
if (lokiPoller != null) { lokiPoller.startIfNeeded(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void stopPollingIfNeeded() {
|
||||||
|
if (lokiPoller != null) { lokiPoller.stopIfNeeded(); }
|
||||||
|
}
|
||||||
|
|
||||||
private void resubmitProfilePictureIfNeeded() {
|
private void resubmitProfilePictureIfNeeded() {
|
||||||
String userPublicKey = TextSecurePreferences.getLocalNumber(this);
|
String userPublicKey = TextSecurePreferences.getLocalNumber(this);
|
||||||
if (userPublicKey == null) return;
|
if (userPublicKey == null) return;
|
||||||
|
@ -145,5 +145,7 @@ class LandingActivity : BaseActionBarActivity(), LinkDeviceSlaveModeDialogDelega
|
|||||||
TextSecurePreferences.removeLocalNumber(this)
|
TextSecurePreferences.removeLocalNumber(this)
|
||||||
TextSecurePreferences.setHasSeenWelcomeScreen(this, false)
|
TextSecurePreferences.setHasSeenWelcomeScreen(this, false)
|
||||||
TextSecurePreferences.setPromptedPushRegistration(this, false)
|
TextSecurePreferences.setPromptedPushRegistration(this, false)
|
||||||
|
val application = ApplicationContext.getInstance(this)
|
||||||
|
application.stopPollingIfNeeded()
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user