mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Update libsignal-service
This commit is contained in:
parent
6ecda07577
commit
ee195c966e
12 changed files with 77 additions and 49 deletions
|
@ -1975,7 +1975,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedBannedMember",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedBannedMember",
|
||||||
"fields":[{"name":"serviceIdBinary_"}, {"name":"timestamp_"}]
|
"fields":[{"name":"serviceIdBinary_"}, {"name":"serviceIdBytes_"}, {"name":"timestamp_"}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedGroup",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedGroup",
|
||||||
|
@ -1991,7 +1991,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedMember",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedMember",
|
||||||
"fields":[{"name":"joinedAtRevision_"}, {"name":"pni_"}, {"name":"profileKey_"}, {"name":"role_"}, {"name":"uuid_"}]
|
"fields":[{"name":"aciBytes_"}, {"name":"joinedAtRevision_"}, {"name":"pniBytes_"}, {"name":"pni_"}, {"name":"profileKey_"}, {"name":"role_"}, {"name":"uuid_"}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedModifyMemberRole",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedModifyMemberRole",
|
||||||
|
@ -1999,7 +1999,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedPendingMember",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedPendingMember",
|
||||||
"fields":[{"name":"addedByUuid_"}, {"name":"role_"}, {"name":"serviceIdBinary_"}, {"name":"timestamp_"}, {"name":"uuidCipherText_"}]
|
"fields":[{"name":"addedByAci_"}, {"name":"addedByUuid_"}, {"name":"role_"}, {"name":"serviceIdBinary_"}, {"name":"serviceIdBytes_"}, {"name":"serviceIdCipherText_"}, {"name":"timestamp_"}, {"name":"uuidCipherText_"}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedPendingMemberRemoval",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedPendingMemberRemoval",
|
||||||
|
@ -2007,7 +2007,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedRequestingMember",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedRequestingMember",
|
||||||
"fields":[{"name":"profileKey_"}, {"name":"timestamp_"}, {"name":"uuid_"}]
|
"fields":[{"name":"aciBytes_"}, {"name":"profileKey_"}, {"name":"timestamp_"}, {"name":"uuid_"}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name":"org.signal.storageservice.protos.groups.local.DecryptedString",
|
"name":"org.signal.storageservice.protos.groups.local.DecryptedString",
|
||||||
|
|
|
@ -102,7 +102,7 @@ public class AccountHelper {
|
||||||
final var whoAmI = dependencies.getAccountManager().getWhoAmI();
|
final var whoAmI = dependencies.getAccountManager().getWhoAmI();
|
||||||
final var number = whoAmI.getNumber();
|
final var number = whoAmI.getNumber();
|
||||||
final var aci = ACI.parseOrThrow(whoAmI.getAci());
|
final var aci = ACI.parseOrThrow(whoAmI.getAci());
|
||||||
final var pni = PNI.parseUnPrefixedOrThrow(whoAmI.getPni());
|
final var pni = PNI.parseOrThrow(whoAmI.getPni());
|
||||||
if (number.equals(account.getNumber()) && aci.equals(account.getAci()) && pni.equals(account.getPni())) {
|
if (number.equals(account.getNumber()) && aci.equals(account.getAci()) && pni.equals(account.getPni())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -447,7 +447,7 @@ public class GroupHelper {
|
||||||
|
|
||||||
private void storeProfileKeysFromMembers(final DecryptedGroup group) {
|
private void storeProfileKeysFromMembers(final DecryptedGroup group) {
|
||||||
for (var member : group.getMembersList()) {
|
for (var member : group.getMembersList()) {
|
||||||
final var serviceId = ServiceId.parseOrThrow(member.getUuid());
|
final var serviceId = ServiceId.parseOrThrow(member.getAciBytes());
|
||||||
final var recipientId = account.getRecipientResolver().resolveRecipient(serviceId);
|
final var recipientId = account.getRecipientResolver().resolveRecipient(serviceId);
|
||||||
final var profileStore = account.getProfileStore();
|
final var profileStore = account.getProfileStore();
|
||||||
if (profileStore.getProfileKey(recipientId) != null) {
|
if (profileStore.getProfileKey(recipientId) != null) {
|
||||||
|
|
|
@ -124,9 +124,10 @@ class GroupV2Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
int findRevisionWeWereAdded(DecryptedGroup partialDecryptedGroup) {
|
int findRevisionWeWereAdded(DecryptedGroup partialDecryptedGroup) {
|
||||||
ByteString bytes = getSelfAci().toByteString();
|
ByteString aciBytes = getSelfAci().toByteString();
|
||||||
|
ByteString pniBytes = getSelfPni().toByteString();
|
||||||
for (DecryptedMember decryptedMember : partialDecryptedGroup.getMembersList()) {
|
for (DecryptedMember decryptedMember : partialDecryptedGroup.getMembersList()) {
|
||||||
if (decryptedMember.getUuid().equals(bytes)) {
|
if (decryptedMember.getAciBytes().equals(aciBytes) || decryptedMember.getPniBytes().equals(pniBytes)) {
|
||||||
return decryptedMember.getJoinedAtRevision();
|
return decryptedMember.getJoinedAtRevision();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,7 +215,7 @@ class GroupV2Helper {
|
||||||
change.setModifyAvatar(GroupChange.Actions.ModifyAvatarAction.newBuilder().setAvatar(avatarCdnKey));
|
change.setModifyAvatar(GroupChange.Actions.ModifyAvatarAction.newBuilder().setAvatar(avatarCdnKey));
|
||||||
}
|
}
|
||||||
|
|
||||||
change.setSourceUuid(getSelfAci().toByteString());
|
change.setSourceServiceId(getSelfAci().toByteString());
|
||||||
|
|
||||||
return commitChange(groupInfoV2, change);
|
return commitChange(groupInfoV2, change);
|
||||||
}
|
}
|
||||||
|
@ -240,7 +241,7 @@ class GroupV2Helper {
|
||||||
final var aci = getSelfAci();
|
final var aci = getSelfAci();
|
||||||
final var change = groupOperations.createModifyGroupMembershipChange(candidates, bannedUuids, aci);
|
final var change = groupOperations.createModifyGroupMembershipChange(candidates, bannedUuids, aci);
|
||||||
|
|
||||||
change.setSourceUuid(getSelfAci().toByteString());
|
change.setSourceServiceId(getSelfAci().toByteString());
|
||||||
|
|
||||||
return commitChange(groupInfoV2, change);
|
return commitChange(groupInfoV2, change);
|
||||||
}
|
}
|
||||||
|
@ -262,8 +263,7 @@ class GroupV2Helper {
|
||||||
.map(ServiceId::getRawUuid)
|
.map(ServiceId::getRawUuid)
|
||||||
.toList();
|
.toList();
|
||||||
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
||||||
return commitChange(groupInfoV2,
|
return commitChange(groupInfoV2, groupOperations.createLeaveAndPromoteMembersToAdmin(selfAci, adminUuids));
|
||||||
groupOperations.createLeaveAndPromoteMembersToAdmin(selfAci.getRawUuid(), adminUuids));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Pair<DecryptedGroup, GroupChange> removeMembers(
|
Pair<DecryptedGroup, GroupChange> removeMembers(
|
||||||
|
@ -272,7 +272,8 @@ class GroupV2Helper {
|
||||||
final var memberUuids = members.stream()
|
final var memberUuids = members.stream()
|
||||||
.map(context.getRecipientHelper()::resolveSignalServiceAddress)
|
.map(context.getRecipientHelper()::resolveSignalServiceAddress)
|
||||||
.map(SignalServiceAddress::getServiceId)
|
.map(SignalServiceAddress::getServiceId)
|
||||||
.map(ServiceId::getRawUuid)
|
.filter(m -> m instanceof ACI)
|
||||||
|
.map(m -> (ACI) m)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
return ejectMembers(groupInfoV2, memberUuids);
|
return ejectMembers(groupInfoV2, memberUuids);
|
||||||
}
|
}
|
||||||
|
@ -294,7 +295,6 @@ class GroupV2Helper {
|
||||||
final var memberUuids = members.stream()
|
final var memberUuids = members.stream()
|
||||||
.map(context.getRecipientHelper()::resolveSignalServiceAddress)
|
.map(context.getRecipientHelper()::resolveSignalServiceAddress)
|
||||||
.map(SignalServiceAddress::getServiceId)
|
.map(SignalServiceAddress::getServiceId)
|
||||||
.map(ServiceId::getRawUuid)
|
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
return refuseJoinRequest(groupInfoV2, memberUuids);
|
return refuseJoinRequest(groupInfoV2, memberUuids);
|
||||||
}
|
}
|
||||||
|
@ -318,18 +318,15 @@ class GroupV2Helper {
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
||||||
|
|
||||||
final var uuids = block.stream()
|
final var serviceIds = block.stream()
|
||||||
.map(member -> context.getRecipientHelper()
|
.map(member -> context.getRecipientHelper().resolveSignalServiceAddress(member).getServiceId())
|
||||||
.resolveSignalServiceAddress(member)
|
|
||||||
.getServiceId()
|
|
||||||
.getRawUuid())
|
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
|
|
||||||
final var change = groupOperations.createBanUuidsChange(uuids,
|
final var change = groupOperations.createBanServiceIdsChange(serviceIds,
|
||||||
false,
|
false,
|
||||||
groupInfoV2.getGroup().getBannedMembersList());
|
groupInfoV2.getGroup().getBannedMembersList());
|
||||||
|
|
||||||
change.setSourceUuid(getSelfAci().toByteString());
|
change.setSourceServiceId(getSelfAci().toByteString());
|
||||||
|
|
||||||
return commitChange(groupInfoV2, change);
|
return commitChange(groupInfoV2, change);
|
||||||
}
|
}
|
||||||
|
@ -345,7 +342,7 @@ class GroupV2Helper {
|
||||||
|
|
||||||
final var change = groupOperations.createUnbanServiceIdsChange(serviceIds);
|
final var change = groupOperations.createUnbanServiceIdsChange(serviceIds);
|
||||||
|
|
||||||
change.setSourceUuid(getSelfAci().toByteString());
|
change.setSourceServiceId(getSelfAci().toByteString());
|
||||||
|
|
||||||
return commitChange(groupInfoV2, change);
|
return commitChange(groupInfoV2, change);
|
||||||
}
|
}
|
||||||
|
@ -396,8 +393,7 @@ class GroupV2Helper {
|
||||||
Pair<DecryptedGroup, GroupChange> updateSelfProfileKey(GroupInfoV2 groupInfoV2) throws IOException {
|
Pair<DecryptedGroup, GroupChange> updateSelfProfileKey(GroupInfoV2 groupInfoV2) throws IOException {
|
||||||
Optional<DecryptedMember> selfInGroup = groupInfoV2.getGroup() == null
|
Optional<DecryptedMember> selfInGroup = groupInfoV2.getGroup() == null
|
||||||
? Optional.empty()
|
? Optional.empty()
|
||||||
: DecryptedGroupUtil.findMemberByUuid(groupInfoV2.getGroup().getMembersList(),
|
: DecryptedGroupUtil.findMemberByAci(groupInfoV2.getGroup().getMembersList(), getSelfAci());
|
||||||
getSelfAci().getRawUuid());
|
|
||||||
if (selfInGroup.isEmpty()) {
|
if (selfInGroup.isEmpty()) {
|
||||||
logger.trace("Not updating group, self not in group " + groupInfoV2.getGroupId().toBase64());
|
logger.trace("Not updating group, self not in group " + groupInfoV2.getGroupId().toBase64());
|
||||||
return null;
|
return null;
|
||||||
|
@ -420,7 +416,7 @@ class GroupV2Helper {
|
||||||
|
|
||||||
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
||||||
final var change = groupOperations.createUpdateProfileKeyCredentialChange(profileKeyCredential);
|
final var change = groupOperations.createUpdateProfileKeyCredentialChange(profileKeyCredential);
|
||||||
change.setSourceUuid(getSelfAci().toByteString());
|
change.setSourceServiceId(getSelfAci().toByteString());
|
||||||
return commitChange(groupInfoV2, change);
|
return commitChange(groupInfoV2, change);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,7 +439,7 @@ class GroupV2Helper {
|
||||||
? groupOperations.createGroupJoinRequest(profileKeyCredential)
|
? groupOperations.createGroupJoinRequest(profileKeyCredential)
|
||||||
: groupOperations.createGroupJoinDirect(profileKeyCredential);
|
: groupOperations.createGroupJoinDirect(profileKeyCredential);
|
||||||
|
|
||||||
change.setSourceUuid(context.getRecipientHelper()
|
change.setSourceServiceId(context.getRecipientHelper()
|
||||||
.resolveSignalServiceAddress(selfRecipientId)
|
.resolveSignalServiceAddress(selfRecipientId)
|
||||||
.getServiceId()
|
.getServiceId()
|
||||||
.toByteString());
|
.toByteString());
|
||||||
|
@ -463,7 +459,7 @@ class GroupV2Helper {
|
||||||
final var change = groupOperations.createAcceptInviteChange(profileKeyCredential);
|
final var change = groupOperations.createAcceptInviteChange(profileKeyCredential);
|
||||||
|
|
||||||
final var aci = context.getRecipientHelper().resolveSignalServiceAddress(selfRecipientId).getServiceId();
|
final var aci = context.getRecipientHelper().resolveSignalServiceAddress(selfRecipientId).getServiceId();
|
||||||
change.setSourceUuid(aci.toByteString());
|
change.setSourceServiceId(aci.toByteString());
|
||||||
|
|
||||||
return commitChange(groupInfoV2, change);
|
return commitChange(groupInfoV2, change);
|
||||||
}
|
}
|
||||||
|
@ -524,7 +520,7 @@ class GroupV2Helper {
|
||||||
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
||||||
final var uuidCipherTexts = pendingMembers.stream().map(member -> {
|
final var uuidCipherTexts = pendingMembers.stream().map(member -> {
|
||||||
try {
|
try {
|
||||||
return new UuidCiphertext(member.getUuidCipherText().toByteArray());
|
return new UuidCiphertext(member.getServiceIdCipherText().toByteArray());
|
||||||
} catch (InvalidInputException e) {
|
} catch (InvalidInputException e) {
|
||||||
throw new AssertionError(e);
|
throw new AssertionError(e);
|
||||||
}
|
}
|
||||||
|
@ -540,17 +536,17 @@ class GroupV2Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Pair<DecryptedGroup, GroupChange> refuseJoinRequest(
|
private Pair<DecryptedGroup, GroupChange> refuseJoinRequest(
|
||||||
GroupInfoV2 groupInfoV2, Set<UUID> uuids
|
GroupInfoV2 groupInfoV2, Set<ServiceId> serviceIds
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
||||||
return commitChange(groupInfoV2, groupOperations.createRefuseGroupJoinRequest(uuids, false, List.of()));
|
return commitChange(groupInfoV2, groupOperations.createRefuseGroupJoinRequest(serviceIds, false, List.of()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Pair<DecryptedGroup, GroupChange> ejectMembers(
|
private Pair<DecryptedGroup, GroupChange> ejectMembers(
|
||||||
GroupInfoV2 groupInfoV2, Set<UUID> uuids
|
GroupInfoV2 groupInfoV2, Set<ACI> members
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
final GroupsV2Operations.GroupOperations groupOperations = getGroupOperations(groupInfoV2);
|
||||||
return commitChange(groupInfoV2, groupOperations.createRemoveMembersChange(uuids, false, List.of()));
|
return commitChange(groupInfoV2, groupOperations.createRemoveMembersChange(members, false, List.of()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Pair<DecryptedGroup, GroupChange> commitChange(
|
private Pair<DecryptedGroup, GroupChange> commitChange(
|
||||||
|
@ -593,16 +589,16 @@ class GroupV2Helper {
|
||||||
}
|
}
|
||||||
|
|
||||||
Pair<ServiceId, ProfileKey> getAuthoritativeProfileKeyFromChange(final DecryptedGroupChange change) {
|
Pair<ServiceId, ProfileKey> getAuthoritativeProfileKeyFromChange(final DecryptedGroupChange change) {
|
||||||
UUID editor = UuidUtil.fromByteStringOrNull(change.getEditor());
|
UUID editor = UuidUtil.fromByteStringOrNull(change.getEditorServiceIdBytes());
|
||||||
final var editorProfileKeyBytes = Stream.concat(Stream.of(change.getNewMembersList().stream(),
|
final var editorProfileKeyBytes = Stream.concat(Stream.of(change.getNewMembersList().stream(),
|
||||||
change.getPromotePendingMembersList().stream(),
|
change.getPromotePendingMembersList().stream(),
|
||||||
change.getModifiedProfileKeysList().stream())
|
change.getModifiedProfileKeysList().stream())
|
||||||
.flatMap(Function.identity())
|
.flatMap(Function.identity())
|
||||||
.filter(m -> UuidUtil.fromByteString(m.getUuid()).equals(editor))
|
.filter(m -> UuidUtil.fromByteString(m.getAciBytes()).equals(editor))
|
||||||
.map(DecryptedMember::getProfileKey),
|
.map(DecryptedMember::getProfileKey),
|
||||||
change.getNewRequestingMembersList()
|
change.getNewRequestingMembersList()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(m -> UuidUtil.fromByteString(m.getUuid()).equals(editor))
|
.filter(m -> UuidUtil.fromByteString(m.getAciBytes()).equals(editor))
|
||||||
.map(DecryptedRequestingMember::getProfileKey)).findFirst();
|
.map(DecryptedRequestingMember::getProfileKey)).findFirst();
|
||||||
|
|
||||||
if (editorProfileKeyBytes.isEmpty()) {
|
if (editorProfileKeyBytes.isEmpty()) {
|
||||||
|
|
|
@ -101,14 +101,14 @@ public class StorageHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
final var contactRecord = record.getContact().get();
|
final var contactRecord = record.getContact().get();
|
||||||
final var aci = contactRecord.getAci();
|
final var aci = contactRecord.getAci().orElse(null);
|
||||||
final var pni = contactRecord.getPni().orElse(null);
|
final var pni = contactRecord.getPni().orElse(null);
|
||||||
if (contactRecord.getNumber().isEmpty() && aci.isUnknown()) {
|
if (contactRecord.getNumber().isEmpty() && aci == null && pni == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final var address = new RecipientAddress(aci, pni, contactRecord.getNumber().orElse(null));
|
final var address = new RecipientAddress(aci, pni, contactRecord.getNumber().orElse(null));
|
||||||
var recipientId = account.getRecipientResolver().resolveRecipient(address);
|
var recipientId = account.getRecipientResolver().resolveRecipient(address);
|
||||||
if (aci.isValid() && contactRecord.getUsername().isPresent()) {
|
if (aci != null && contactRecord.getUsername().isPresent()) {
|
||||||
recipientId = account.getRecipientTrustedResolver()
|
recipientId = account.getRecipientTrustedResolver()
|
||||||
.resolveRecipientTrusted(aci, contactRecord.getUsername().get());
|
.resolveRecipientTrusted(aci, contactRecord.getUsername().get());
|
||||||
}
|
}
|
||||||
|
@ -171,7 +171,7 @@ public class StorageHelper {
|
||||||
logger.warn("Received invalid contact profile key from storage");
|
logger.warn("Received invalid contact profile key from storage");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (contactRecord.getIdentityKey().isPresent() && aci.isValid()) {
|
if (contactRecord.getIdentityKey().isPresent() && aci != null) {
|
||||||
try {
|
try {
|
||||||
logger.trace("Storing identity key {}", recipientId);
|
logger.trace("Storing identity key {}", recipientId);
|
||||||
final var identityKey = new IdentityKey(contactRecord.getIdentityKey().get());
|
final var identityKey = new IdentityKey(contactRecord.getIdentityKey().get());
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class RegistrationManagerImpl implements RegistrationManager {
|
||||||
|
|
||||||
//accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID)));
|
//accountManager.setGcmId(Optional.of(GoogleCloudMessaging.getInstance(this).register(REGISTRATION_ID)));
|
||||||
final var aci = ACI.parseOrThrow(response.getUuid());
|
final var aci = ACI.parseOrThrow(response.getUuid());
|
||||||
final var pni = PNI.parseUnPrefixedOrThrow(response.getPni());
|
final var pni = PNI.parseOrThrow(response.getPni());
|
||||||
account.finishRegistration(aci, pni, masterKey, pin, aciPreKeys, pniPreKeys);
|
account.finishRegistration(aci, pni, masterKey, pin, aciPreKeys, pniPreKeys);
|
||||||
accountFileUpdater.updateAccountIdentifiers(account.getNumber(), aci);
|
accountFileUpdater.updateAccountIdentifiers(account.getNumber(), aci);
|
||||||
|
|
||||||
|
|
|
@ -556,7 +556,7 @@ public class SignalAccount implements Closeable {
|
||||||
}
|
}
|
||||||
if (rootNode.hasNonNull("pni")) {
|
if (rootNode.hasNonNull("pni")) {
|
||||||
try {
|
try {
|
||||||
pni = PNI.parseUnPrefixedOrThrow(rootNode.get("pni").asText());
|
pni = PNI.parseOrThrow(rootNode.get("pni").asText());
|
||||||
} catch (IllegalArgumentException e) {
|
} catch (IllegalArgumentException e) {
|
||||||
throw new IOException("Config file contains an invalid pni, needs to be a valid UUID", e);
|
throw new IOException("Config file contains an invalid pni, needs to be a valid UUID", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.asamk.signal.manager.storage.groups;
|
||||||
import org.asamk.signal.manager.api.GroupIdV2;
|
import org.asamk.signal.manager.api.GroupIdV2;
|
||||||
import org.asamk.signal.manager.api.GroupInviteLinkUrl;
|
import org.asamk.signal.manager.api.GroupInviteLinkUrl;
|
||||||
import org.asamk.signal.manager.api.GroupPermission;
|
import org.asamk.signal.manager.api.GroupPermission;
|
||||||
|
import org.asamk.signal.manager.storage.recipients.RecipientAddress;
|
||||||
import org.asamk.signal.manager.storage.recipients.RecipientId;
|
import org.asamk.signal.manager.storage.recipients.RecipientId;
|
||||||
import org.asamk.signal.manager.storage.recipients.RecipientResolver;
|
import org.asamk.signal.manager.storage.recipients.RecipientResolver;
|
||||||
import org.signal.libsignal.zkgroup.groups.GroupMasterKey;
|
import org.signal.libsignal.zkgroup.groups.GroupMasterKey;
|
||||||
|
@ -114,7 +115,7 @@ public final class GroupInfoV2 extends GroupInfo {
|
||||||
}
|
}
|
||||||
return group.getMembersList()
|
return group.getMembersList()
|
||||||
.stream()
|
.stream()
|
||||||
.map(m -> ServiceId.parseOrThrow(m.getUuid()))
|
.map(m -> ServiceId.parseOrThrow(m.getAciBytes()))
|
||||||
.map(recipientResolver::resolveRecipient)
|
.map(recipientResolver::resolveRecipient)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
@ -126,7 +127,7 @@ public final class GroupInfoV2 extends GroupInfo {
|
||||||
}
|
}
|
||||||
return group.getBannedMembersList()
|
return group.getBannedMembersList()
|
||||||
.stream()
|
.stream()
|
||||||
.map(m -> ServiceId.parseOrThrow(m.getServiceIdBinary()))
|
.map(m -> ServiceId.parseOrThrow(m.getServiceIdBytes()))
|
||||||
.map(recipientResolver::resolveRecipient)
|
.map(recipientResolver::resolveRecipient)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
@ -138,7 +139,7 @@ public final class GroupInfoV2 extends GroupInfo {
|
||||||
}
|
}
|
||||||
return group.getPendingMembersList()
|
return group.getPendingMembersList()
|
||||||
.stream()
|
.stream()
|
||||||
.map(m -> ServiceId.parseOrThrow(m.getServiceIdBinary()))
|
.map(m -> ServiceId.parseOrThrow(m.getServiceIdBytes()))
|
||||||
.map(recipientResolver::resolveRecipient)
|
.map(recipientResolver::resolveRecipient)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
@ -150,7 +151,7 @@ public final class GroupInfoV2 extends GroupInfo {
|
||||||
}
|
}
|
||||||
return group.getRequestingMembersList()
|
return group.getRequestingMembersList()
|
||||||
.stream()
|
.stream()
|
||||||
.map(m -> ServiceId.parseOrThrow(m.getUuid()))
|
.map(m -> ServiceId.parseOrThrow(m.getAciBytes()))
|
||||||
.map(recipientResolver::resolveRecipient)
|
.map(recipientResolver::resolveRecipient)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
@ -163,7 +164,9 @@ public final class GroupInfoV2 extends GroupInfo {
|
||||||
return group.getMembersList()
|
return group.getMembersList()
|
||||||
.stream()
|
.stream()
|
||||||
.filter(m -> m.getRole() == Member.Role.ADMINISTRATOR)
|
.filter(m -> m.getRole() == Member.Role.ADMINISTRATOR)
|
||||||
.map(m -> ServiceId.parseOrThrow(m.getUuid()))
|
.map(m -> new RecipientAddress(ServiceId.ACI.parseOrNull(m.getAciBytes()),
|
||||||
|
ServiceId.PNI.parseOrNull(m.getPniBytes()),
|
||||||
|
null))
|
||||||
.map(recipientResolver::resolveRecipient)
|
.map(recipientResolver::resolveRecipient)
|
||||||
.collect(Collectors.toSet());
|
.collect(Collectors.toSet());
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,4 +208,14 @@ public class KyberPreKeyStore implements SignalServiceKyberPreKeyStore {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAllStaleOneTimeKyberPreKeys(final long threshold, final int minCount) {
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void markAllOneTimeKyberPreKeysStaleIfNecessary(final long staleTime) {
|
||||||
|
//TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,4 +242,24 @@ public class SignalProtocolStore implements SignalServiceAccountDataStore {
|
||||||
public void storeLastResortKyberPreKey(final int i, final KyberPreKeyRecord kyberPreKeyRecord) {
|
public void storeLastResortKyberPreKey(final int i, final KyberPreKeyRecord kyberPreKeyRecord) {
|
||||||
kyberPreKeyStore.storeLastResortKyberPreKey(i, kyberPreKeyRecord);
|
kyberPreKeyStore.storeLastResortKyberPreKey(i, kyberPreKeyRecord);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAllStaleOneTimeKyberPreKeys(final long threshold, final int minCount) {
|
||||||
|
kyberPreKeyStore.deleteAllStaleOneTimeKyberPreKeys(threshold, minCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void markAllOneTimeKyberPreKeysStaleIfNecessary(final long staleTime) {
|
||||||
|
kyberPreKeyStore.markAllOneTimeKyberPreKeysStaleIfNecessary(staleTime);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAllStaleOneTimeEcPreKeys(final long l, final int i) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void markAllOneTimeEcPreKeysStaleIfNecessary(final long l) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,6 @@ public class AttachmentUtils {
|
||||||
blurHash,
|
blurHash,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
resumableUploadSpec,
|
resumableUploadSpec);
|
||||||
false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ dependencyResolutionManagement {
|
||||||
library("logback", "ch.qos.logback", "logback-classic").version("1.4.11")
|
library("logback", "ch.qos.logback", "logback-classic").version("1.4.11")
|
||||||
|
|
||||||
|
|
||||||
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_78")
|
library("signalservice", "com.github.turasa", "signal-service-java").version("2.15.3_unofficial_79")
|
||||||
library("protobuf", "com.google.protobuf", "protobuf-javalite").version("3.24.0")
|
library("protobuf", "com.google.protobuf", "protobuf-javalite").version("3.24.0")
|
||||||
library("sqlite", "org.xerial", "sqlite-jdbc").version("3.42.0.1")
|
library("sqlite", "org.xerial", "sqlite-jdbc").version("3.42.0.1")
|
||||||
library("hikari", "com.zaxxer", "HikariCP").version("5.0.1")
|
library("hikari", "com.zaxxer", "HikariCP").version("5.0.1")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue