mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-24 08:58:45 +00:00
Update to libsignal-service 2.5.10
// FREEBIE
This commit is contained in:
@@ -6,6 +6,7 @@ import android.support.annotation.NonNull;
|
||||
import android.util.Log;
|
||||
|
||||
import org.thoughtcrime.securesms.crypto.storage.TextSecureIdentityKeyStore;
|
||||
import org.thoughtcrime.securesms.crypto.storage.TextSecureSessionStore;
|
||||
import org.thoughtcrime.securesms.database.DatabaseFactory;
|
||||
import org.thoughtcrime.securesms.dependencies.InjectableType;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
@@ -20,6 +21,8 @@ import org.whispersystems.libsignal.IdentityKey;
|
||||
import org.whispersystems.libsignal.InvalidKeyException;
|
||||
import org.whispersystems.libsignal.SignalProtocolAddress;
|
||||
import org.whispersystems.libsignal.state.IdentityKeyStore;
|
||||
import org.whispersystems.libsignal.state.SessionRecord;
|
||||
import org.whispersystems.libsignal.state.SessionStore;
|
||||
import org.whispersystems.signalservice.api.SignalServiceMessagePipe;
|
||||
import org.whispersystems.signalservice.api.SignalServiceMessageReceiver;
|
||||
import org.whispersystems.signalservice.api.push.SignalServiceAddress;
|
||||
@@ -89,8 +92,18 @@ public class RetrieveProfileJob extends ContextJob implements InjectableType {
|
||||
}
|
||||
|
||||
synchronized (SESSION_LOCK) {
|
||||
IdentityKeyStore identityKeyStore = new TextSecureIdentityKeyStore(context);
|
||||
identityKeyStore.saveIdentity(new SignalProtocolAddress(recipient.getNumber(), 1), identityKey);
|
||||
IdentityKeyStore identityKeyStore = new TextSecureIdentityKeyStore(context);
|
||||
SessionStore sessionStore = new TextSecureSessionStore(context);
|
||||
SignalProtocolAddress address = new SignalProtocolAddress(number, 1);
|
||||
|
||||
if (identityKeyStore.saveIdentity(address, identityKey)) {
|
||||
if (sessionStore.containsSession(address)) {
|
||||
SessionRecord sessionRecord = sessionStore.loadSession(address);
|
||||
sessionRecord.archiveCurrentState();
|
||||
|
||||
sessionStore.storeSession(address, sessionRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user