mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 08:39:22 +01:00
Add the ability to have separate ACI and PNI protocol stores.
This commit is contained in:
committed by
Cody Henthorne
parent
dd7a2834bc
commit
33f4bb0000
@@ -52,7 +52,7 @@ public final class IdentityUtil {
|
||||
final RecipientId recipientId = recipient.getId();
|
||||
|
||||
SimpleTask.run(SignalExecutors.BOUNDED,
|
||||
() -> ApplicationDependencies.getIdentityStore().getIdentityRecord(recipientId),
|
||||
() -> ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(recipientId),
|
||||
future::set);
|
||||
|
||||
return future;
|
||||
@@ -144,10 +144,10 @@ public final class IdentityUtil {
|
||||
|
||||
public static void saveIdentity(String user, IdentityKey identityKey) {
|
||||
try(SignalSessionLock.Lock unused = ReentrantSessionLock.INSTANCE.acquire()) {
|
||||
SessionStore sessionStore = ApplicationDependencies.getSessionStore();
|
||||
SessionStore sessionStore = ApplicationDependencies.getProtocolStore().aci();
|
||||
SignalProtocolAddress address = new SignalProtocolAddress(user, SignalServiceAddress.DEFAULT_DEVICE_ID);
|
||||
|
||||
if (ApplicationDependencies.getIdentityStore().saveIdentity(address, identityKey)) {
|
||||
if (ApplicationDependencies.getProtocolStore().aci().identities().saveIdentity(address, identityKey)) {
|
||||
if (sessionStore.containsSession(address)) {
|
||||
SessionRecord sessionRecord = sessionStore.loadSession(address);
|
||||
sessionRecord.archiveCurrentState();
|
||||
@@ -160,7 +160,7 @@ public final class IdentityUtil {
|
||||
|
||||
public static void processVerifiedMessage(Context context, VerifiedMessage verifiedMessage) {
|
||||
try(SignalSessionLock.Lock unused = ReentrantSessionLock.INSTANCE.acquire()) {
|
||||
TextSecureIdentityKeyStore identityStore = ApplicationDependencies.getIdentityStore();
|
||||
TextSecureIdentityKeyStore identityStore = ApplicationDependencies.getProtocolStore().aci().identities();
|
||||
Recipient recipient = Recipient.externalPush(context, verifiedMessage.getDestination());
|
||||
Optional<IdentityRecord> identityRecord = identityStore.getIdentityRecord(recipient.getId());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user