mirror of
https://github.com/oxen-io/session-android.git
synced 2025-08-12 17:07:42 +00:00
Simplify & fix from_server_id
usage
This commit is contained in:
@@ -205,11 +205,11 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
contactDB.setContact(contact);
|
||||
}
|
||||
}
|
||||
|
||||
if (poller != null) {
|
||||
poller.setCaughtUp(false);
|
||||
}
|
||||
startPollingIfNeeded();
|
||||
|
||||
OpenGroupManager.INSTANCE.setAllCaughtUp(false);
|
||||
OpenGroupManager.INSTANCE.startPolling();
|
||||
}
|
||||
|
@@ -66,8 +66,6 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
|
||||
// region Lifecycle
|
||||
override fun onCreate(savedInstanceState: Bundle?, isReady: Boolean) {
|
||||
super.onCreate(savedInstanceState, isReady)
|
||||
// Check when Session was last opened
|
||||
setPollingLimit();
|
||||
// Double check that the long poller is up
|
||||
(applicationContext as ApplicationContext).startPollingIfNeeded()
|
||||
// Set content view
|
||||
@@ -192,15 +190,6 @@ class HomeActivity : PassphraseRequiredActionBarActivity(),
|
||||
super.onDestroy()
|
||||
EventBus.getDefault().unregister(this)
|
||||
}
|
||||
|
||||
fun setPollingLimit() {
|
||||
val lastTimeSessionOpened = TextSecurePreferences.getLastTimeSessionOpened(this)
|
||||
val timeSinceLastTimeOpen = System.currentTimeMillis() - lastTimeSessionOpened
|
||||
|
||||
// activate polling limit on open groups if the app hasn't been opened for more than the duration set in MAX_INACTIVITY_PERIOD
|
||||
TextSecurePreferences.setOpenGroupPollingLimit(this, timeSinceLastTimeOpen > OpenGroupPollerV2.maxInactivityPeriod)
|
||||
TextSecurePreferences.setLastTimeSessionOpened(this)
|
||||
}
|
||||
// endregion
|
||||
|
||||
// region Updating
|
||||
|
Reference in New Issue
Block a user