mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 00:29:11 +01:00
Use strongly-typed ACIs and PNIs everywhere.
This commit is contained in:
@@ -69,8 +69,8 @@ public class SignalBaseIdentityKeyStore {
|
||||
|
||||
public @NonNull SaveResult saveIdentity(SignalProtocolAddress address, IdentityKey identityKey, boolean nonBlockingApproval) {
|
||||
try (SignalSessionLock.Lock unused = ReentrantSessionLock.INSTANCE.acquire()) {
|
||||
IdentityStoreRecord identityRecord = cache.get(address.getName());
|
||||
RecipientId recipientId = RecipientId.fromSidOrE164(address.getName());
|
||||
IdentityStoreRecord identityRecord = cache.get(address.getName());
|
||||
RecipientId recipientId = RecipientId.fromSidOrE164(address.getName());
|
||||
|
||||
if (identityRecord == null) {
|
||||
Log.i(TAG, "Saving new identity for " + address);
|
||||
|
||||
@@ -6,7 +6,6 @@ import androidx.annotation.Nullable;
|
||||
import org.signal.core.util.logging.Log;
|
||||
import org.signal.libsignal.protocol.NoSessionException;
|
||||
import org.signal.libsignal.protocol.SignalProtocolAddress;
|
||||
import org.signal.libsignal.protocol.message.CiphertextMessage;
|
||||
import org.signal.libsignal.protocol.state.SessionRecord;
|
||||
import org.thoughtcrime.securesms.crypto.ReentrantSessionLock;
|
||||
import org.thoughtcrime.securesms.database.SessionTable;
|
||||
@@ -126,13 +125,23 @@ public class TextSecureSessionStore implements SignalServiceSessionStore {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void archiveSession(@NonNull ServiceId serviceId, int deviceId) {
|
||||
try (SignalSessionLock.Lock unused = ReentrantSessionLock.INSTANCE.acquire()) {
|
||||
archiveSession(new SignalProtocolAddress(serviceId.toString(), deviceId));
|
||||
}
|
||||
}
|
||||
|
||||
public void archiveSession(@NonNull RecipientId recipientId, int deviceId) {
|
||||
public void archiveSessions(@NonNull RecipientId recipientId, int deviceId) {
|
||||
try (SignalSessionLock.Lock unused = ReentrantSessionLock.INSTANCE.acquire()) {
|
||||
Recipient recipient = Recipient.resolved(recipientId);
|
||||
|
||||
if (recipient.hasServiceId()) {
|
||||
archiveSession(new SignalProtocolAddress(recipient.requireServiceId().toString(), deviceId));
|
||||
if (recipient.hasAci()) {
|
||||
archiveSession(new SignalProtocolAddress(recipient.requireAci().toString(), deviceId));
|
||||
}
|
||||
|
||||
if (recipient.hasPni()) {
|
||||
archiveSession(new SignalProtocolAddress(recipient.requirePni().toString(), deviceId));
|
||||
}
|
||||
|
||||
if (recipient.hasE164()) {
|
||||
|
||||
Reference in New Issue
Block a user