mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-25 01:07:47 +00:00
Clean
This commit is contained in:
parent
6fcc26cc22
commit
4e672d5b49
@ -487,7 +487,8 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
String userPublicKey = TextSecurePreferences.getLocalNumber(this);
|
||||
if (userPublicKey == null) return;
|
||||
if (lokiPoller != null) {
|
||||
lokiPoller.updateUserHexEncodedPublicKey(userPublicKey);
|
||||
LokiAPI.shared.setUserHexEncodedPublicKey(userPublicKey);
|
||||
lokiPoller.setUserHexEncodedPublicKey(userPublicKey);
|
||||
return;
|
||||
}
|
||||
LokiAPIDatabase apiDB = DatabaseFactory.getLokiAPIDatabase(this);
|
||||
@ -507,8 +508,9 @@ public class ApplicationContext extends MultiDexApplication implements Dependenc
|
||||
if (lokiPoller != null) { lokiPoller.startIfNeeded(); }
|
||||
}
|
||||
|
||||
public void stopPollingIfNeeded() {
|
||||
if (lokiPoller != null) { lokiPoller.stopIfNeeded(); }
|
||||
public void stopPolling() {
|
||||
if (lokiPoller == null) { return; }
|
||||
lokiPoller.stopIfNeeded();
|
||||
}
|
||||
|
||||
private void resubmitProfilePictureIfNeeded() {
|
||||
|
@ -146,6 +146,6 @@ class LandingActivity : BaseActionBarActivity(), LinkDeviceSlaveModeDialogDelega
|
||||
TextSecurePreferences.setHasSeenWelcomeScreen(this, false)
|
||||
TextSecurePreferences.setPromptedPushRegistration(this, false)
|
||||
val application = ApplicationContext.getInstance(this)
|
||||
application.stopPollingIfNeeded()
|
||||
application.stopPolling()
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ import org.whispersystems.libsignal.SignalProtocolAddress
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceContent
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceGroup
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress
|
||||
import org.whispersystems.signalservice.loki.api.LokiAPI
|
||||
import org.whispersystems.signalservice.loki.api.fileserver.LokiFileServerAPI
|
||||
import org.whispersystems.signalservice.loki.protocol.multidevice.MultiDeviceProtocol
|
||||
import java.util.*
|
||||
@ -108,6 +109,7 @@ object ClosedGroupsProtocol {
|
||||
val deviceAsAddress = SignalProtocolAddress(device, SignalServiceAddress.DEFAULT_DEVICE_ID)
|
||||
val hasSession = TextSecureSessionStore(context).containsSession(deviceAsAddress)
|
||||
if (hasSession) { continue }
|
||||
if (DatabaseFactory.getLokiAPIDatabase(context).getSessionRequestTimestamp(device) != null) { return }
|
||||
DatabaseFactory.getLokiAPIDatabase(context).setSessionRequestTimestamp(device, Date().time)
|
||||
val sessionRequest = EphemeralMessage.createSessionRequest(device)
|
||||
ApplicationContext.getInstance(context).jobManager.add(PushEphemeralMessageSendJob(sessionRequest))
|
||||
|
Loading…
x
Reference in New Issue
Block a user