"name":"sun.security.x509.CRLDistributionPointsExtension",
"methods":[{"name":"<init>","parameterTypes":["java.lang.Boolean","java.lang.Object"] }]
},
+{
+ "name":"sun.security.x509.ExtendedKeyUsageExtension",
+ "methods":[{"name":"<init>","parameterTypes":["java.lang.Boolean","java.lang.Object"] }]
+},
{
"name":"sun.security.x509.KeyUsageExtension",
"methods":[{"name":"<init>","parameterTypes":["java.lang.Boolean","java.lang.Object"] }]
package org.asamk.signal.manager;
import org.asamk.signal.manager.groups.GroupId;
+import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.util.IOUtils;
import org.asamk.signal.manager.util.Utils;
-import org.whispersystems.signalservice.api.push.SignalServiceAddress;
import org.whispersystems.signalservice.api.util.StreamDetails;
import java.io.File;
this.avatarsPath = avatarsPath;
}
- public StreamDetails retrieveContactAvatar(SignalServiceAddress address) throws IOException {
+ public StreamDetails retrieveContactAvatar(RecipientAddress address) throws IOException {
return retrieveAvatar(getContactAvatarFile(address));
}
- public StreamDetails retrieveProfileAvatar(SignalServiceAddress address) throws IOException {
+ public StreamDetails retrieveProfileAvatar(RecipientAddress address) throws IOException {
return retrieveAvatar(getProfileAvatarFile(address));
}
return retrieveAvatar(groupAvatarFile);
}
- public void storeContactAvatar(SignalServiceAddress address, AvatarStorer storer) throws IOException {
+ public void storeContactAvatar(RecipientAddress address, AvatarStorer storer) throws IOException {
storeAvatar(getContactAvatarFile(address), storer);
}
- public void storeProfileAvatar(SignalServiceAddress address, AvatarStorer storer) throws IOException {
+ public void storeProfileAvatar(RecipientAddress address, AvatarStorer storer) throws IOException {
storeAvatar(getProfileAvatarFile(address), storer);
}
storeAvatar(getGroupAvatarFile(groupId), storer);
}
- public void deleteProfileAvatar(SignalServiceAddress address) throws IOException {
+ public void deleteProfileAvatar(RecipientAddress address) throws IOException {
deleteAvatar(getProfileAvatarFile(address));
}
return new File(avatarsPath, "group-" + groupId.toBase64().replace("/", "_"));
}
- private File getContactAvatarFile(SignalServiceAddress address) {
- return new File(avatarsPath, "contact-" + getLegacyIdentifier(address));
+ private File getContactAvatarFile(RecipientAddress address) {
+ return new File(avatarsPath, "contact-" + address.getLegacyIdentifier());
}
- private String getLegacyIdentifier(final SignalServiceAddress address) {
- return address.getNumber().or(() -> address.getAci().toString());
- }
-
- private File getProfileAvatarFile(SignalServiceAddress address) {
- return new File(avatarsPath, "profile-" + getLegacyIdentifier(address));
+ private File getProfileAvatarFile(RecipientAddress address) {
+ return new File(avatarsPath, "profile-" + address.getLegacyIdentifier());
}
private void createAvatarsDir() throws IOException {
import org.asamk.signal.manager.config.ServiceConfig;
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.recipients.Profile;
+import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.storage.recipients.RecipientId;
import org.asamk.signal.manager.util.IOUtils;
import org.asamk.signal.manager.util.ProfileUtils;
if (uploadProfile) {
try (final var streamDetails = avatar == null
? context.getAvatarStore()
- .retrieveProfileAvatar(account.getSelfAddress())
+ .retrieveProfileAvatar(account.getSelfRecipientAddress())
: avatar.isPresent() ? Utils.createStreamDetailsFromFile(avatar.get()) : null) {
final var avatarPath = dependencies.getAccountManager()
.setVersionedProfile(account.getAci(),
if (avatar != null) {
if (avatar.isPresent()) {
context.getAvatarStore()
- .storeProfileAvatar(account.getSelfAddress(),
+ .storeProfileAvatar(account.getSelfRecipientAddress(),
outputStream -> IOUtils.copyFileToStream(avatar.get(), outputStream));
} else {
- context.getAvatarStore().deleteProfileAvatar(account.getSelfAddress());
+ context.getAvatarStore().deleteProfileAvatar(account.getSelfRecipientAddress());
}
}
account.getProfileStore().storeProfile(account.getSelfRecipientId(), newProfile);
var profile = account.getProfileStore().getProfile(recipientId);
if (profile == null || !Objects.equals(avatarPath, profile.getAvatarUrlPath())) {
logger.trace("Downloading profile avatar for {}", recipientId);
- downloadProfileAvatar(context.getRecipientHelper().resolveSignalServiceAddress(recipientId),
+ downloadProfileAvatar(account.getRecipientStore().resolveRecipientAddress(recipientId),
avatarPath,
profileKey);
var builder = profile == null ? Profile.newBuilder() : Profile.newBuilder(profile);
}
private void downloadProfileAvatar(
- SignalServiceAddress address, String avatarPath, ProfileKey profileKey
+ RecipientAddress address, String avatarPath, ProfileKey profileKey
) {
if (avatarPath == null) {
try {
import org.asamk.signal.manager.storage.SignalAccount;
import org.asamk.signal.manager.storage.groups.GroupInfoV1;
import org.asamk.signal.manager.storage.recipients.Contact;
+import org.asamk.signal.manager.storage.recipients.RecipientAddress;
import org.asamk.signal.manager.util.AttachmentUtils;
import org.asamk.signal.manager.util.IOUtils;
import org.slf4j.Logger;
var profileKey = account.getProfileStore().getProfileKey(recipientId);
out.write(new DeviceContact(address,
Optional.fromNullable(contact.getName()),
- createContactAvatarAttachment(address),
+ createContactAvatarAttachment(new RecipientAddress(address)),
Optional.fromNullable(contact.getColor()),
Optional.fromNullable(verifiedMessage),
Optional.fromNullable(profileKey),
account.getContactStore().storeContact(recipientId, builder.build());
if (c.getAvatar().isPresent()) {
- downloadContactAvatar(c.getAvatar().get(), c.getAddress());
+ downloadContactAvatar(c.getAvatar().get(), new RecipientAddress(c.getAddress()));
}
}
}
context.getSendHelper().sendSyncMessage(message);
}
- private Optional<SignalServiceAttachmentStream> createContactAvatarAttachment(SignalServiceAddress address) throws IOException {
+ private Optional<SignalServiceAttachmentStream> createContactAvatarAttachment(RecipientAddress address) throws IOException {
final var streamDetails = context.getAvatarStore().retrieveContactAvatar(address);
if (streamDetails == null) {
return Optional.absent();
return Optional.of(AttachmentUtils.createAttachment(streamDetails, Optional.absent()));
}
- private void downloadContactAvatar(SignalServiceAttachment avatar, SignalServiceAddress address) {
+ private void downloadContactAvatar(SignalServiceAttachment avatar, RecipientAddress address) {
try {
context.getAvatarStore()
.storeContactAvatar(address,
if (legacyRecipientStore != null) {
getRecipientStore().resolveRecipientsTrusted(legacyRecipientStore.getAddresses());
}
- getSelfRecipientId();
+ getRecipientStore().resolveRecipientTrusted(getSelfRecipientAddress());
migrated = true;
}
return new SignalServiceAddress(aci, account);
}
+ public RecipientAddress getSelfRecipientAddress() {
+ return new RecipientAddress(aci == null ? null : aci.uuid(), account);
+ }
+
public RecipientId getSelfRecipientId() {
- return getRecipientStore().resolveRecipientTrusted(new RecipientAddress(aci == null ? null : aci.uuid(),
- account));
+ return getRecipientStore().resolveRecipient(getSelfRecipientAddress());
}
public String getEncryptedDeviceName() {