mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-21 09:20:19 +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
@@ -561,7 +561,7 @@ public final class MessageContentProcessor {
|
||||
database.markAsMissedCall(smsMessageId.get(), message.getType() == OfferMessage.Type.VIDEO_CALL);
|
||||
} else {
|
||||
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
|
||||
byte[] remoteIdentityKey = ApplicationDependencies.getIdentityStore().getIdentityRecord(senderRecipient.getId()).transform(record -> record.getIdentityKey().serialize()).orNull();
|
||||
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).transform(record -> record.getIdentityKey().serialize()).orNull();
|
||||
|
||||
ApplicationDependencies.getSignalCallManager()
|
||||
.receivedOffer(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()),
|
||||
@@ -579,7 +579,7 @@ public final class MessageContentProcessor {
|
||||
{
|
||||
log(String.valueOf(content), "handleCallAnswerMessage...");
|
||||
RemotePeer remotePeer = new RemotePeer(senderRecipient.getId(), new CallId(message.getId()));
|
||||
byte[] remoteIdentityKey = ApplicationDependencies.getIdentityStore().getIdentityRecord(senderRecipient.getId()).transform(record -> record.getIdentityKey().serialize()).orNull();
|
||||
byte[] remoteIdentityKey = ApplicationDependencies.getProtocolStore().aci().identities().getIdentityRecord(senderRecipient.getId()).transform(record -> record.getIdentityKey().serialize()).orNull();
|
||||
|
||||
ApplicationDependencies.getSignalCallManager()
|
||||
.receivedAnswer(new WebRtcData.CallMetadata(remotePeer, content.getSenderDevice()),
|
||||
@@ -707,7 +707,7 @@ public final class MessageContentProcessor {
|
||||
}
|
||||
|
||||
if (insertResult.isPresent()) {
|
||||
ApplicationDependencies.getSessionStore().deleteAllSessions(content.getSender().getIdentifier());
|
||||
ApplicationDependencies.getProtocolStore().aci().deleteAllSessions(content.getSender().getIdentifier());
|
||||
|
||||
SecurityEvent.broadcastSecurityUpdateEvent(context);
|
||||
ApplicationDependencies.getMessageNotifier().updateNotification(context, insertResult.get().getThreadId());
|
||||
@@ -731,7 +731,7 @@ public final class MessageContentProcessor {
|
||||
long threadId = SignalDatabase.threads().getOrCreateThreadIdFor(recipient);
|
||||
|
||||
if (!recipient.isGroup()) {
|
||||
ApplicationDependencies.getSessionStore().deleteAllSessions(recipient.requireServiceId());
|
||||
ApplicationDependencies.getProtocolStore().aci().deleteAllSessions(recipient.requireServiceId());
|
||||
|
||||
SecurityEvent.broadcastSecurityUpdateEvent(context);
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ import org.signal.libsignal.metadata.SelfSendException;
|
||||
import org.thoughtcrime.securesms.R;
|
||||
import org.thoughtcrime.securesms.crypto.ReentrantSessionLock;
|
||||
import org.thoughtcrime.securesms.crypto.UnidentifiedAccessUtil;
|
||||
import org.thoughtcrime.securesms.crypto.storage.SignalProtocolStoreImpl;
|
||||
import org.thoughtcrime.securesms.database.SignalDatabase;
|
||||
import org.thoughtcrime.securesms.dependencies.ApplicationDependencies;
|
||||
import org.thoughtcrime.securesms.groups.BadGroupIdException;
|
||||
@@ -77,7 +76,7 @@ public final class MessageDecryptionUtil {
|
||||
* caller.
|
||||
*/
|
||||
public static @NonNull DecryptionResult decrypt(@NonNull Context context, @NonNull SignalServiceEnvelope envelope) {
|
||||
SignalProtocolStore axolotlStore = new SignalProtocolStoreImpl(context);
|
||||
SignalProtocolStore axolotlStore = ApplicationDependencies.getProtocolStore().aci();
|
||||
SignalServiceAddress localAddress = new SignalServiceAddress(Recipient.self().requireAci(), Recipient.self().requireE164());
|
||||
SignalServiceCipher cipher = new SignalServiceCipher(localAddress, SignalStore.account().getDeviceId(), axolotlStore, ReentrantSessionLock.INSTANCE, UnidentifiedAccessUtil.getCertificateValidator());
|
||||
List<Job> jobs = new LinkedList<>();
|
||||
|
||||
Reference in New Issue
Block a user