mirror of
https://github.com/AsamK/signal-cli
synced 2025-09-02 04:20:38 +00:00
added a call upon creation to JsonAttachment to set attachmentStoragePath
This commit is contained in:
parent
8ccf5d0bc6
commit
a0bb46b9e6
1 changed files with 6 additions and 1 deletions
|
@ -30,6 +30,7 @@ import org.asamk.signal.storage.protocol.JsonIdentityKeyStore;
|
||||||
import org.asamk.signal.storage.threads.ThreadInfo;
|
import org.asamk.signal.storage.threads.ThreadInfo;
|
||||||
import org.asamk.signal.util.IOUtils;
|
import org.asamk.signal.util.IOUtils;
|
||||||
import org.asamk.signal.util.Util;
|
import org.asamk.signal.util.Util;
|
||||||
|
import org.asamk.signal.JsonAttachment;
|
||||||
import org.signal.libsignal.metadata.InvalidMetadataMessageException;
|
import org.signal.libsignal.metadata.InvalidMetadataMessageException;
|
||||||
import org.signal.libsignal.metadata.InvalidMetadataVersionException;
|
import org.signal.libsignal.metadata.InvalidMetadataVersionException;
|
||||||
import org.signal.libsignal.metadata.ProtocolDuplicateMessageException;
|
import org.signal.libsignal.metadata.ProtocolDuplicateMessageException;
|
||||||
|
@ -144,7 +145,7 @@ public class Manager implements Signal {
|
||||||
this.dataPath = this.settingsPath + "/data";
|
this.dataPath = this.settingsPath + "/data";
|
||||||
this.attachmentsPath = this.settingsPath + "/attachments";
|
this.attachmentsPath = this.settingsPath + "/attachments";
|
||||||
this.avatarsPath = this.settingsPath + "/avatars";
|
this.avatarsPath = this.settingsPath + "/avatars";
|
||||||
|
JsonAttachment.setAttachmentStoragePath(this.attachmentsPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getUsername() {
|
public String getUsername() {
|
||||||
|
@ -1460,6 +1461,10 @@ public class Manager implements Signal {
|
||||||
return new File(attachmentsPath, attachmentId + "");
|
return new File(attachmentsPath, attachmentId + "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getAttachmentFilePath(long attachmentId) {
|
||||||
|
return attachmentsPath + File.separator + attachmentId;
|
||||||
|
}
|
||||||
|
|
||||||
private File retrieveAttachment(SignalServiceAttachmentPointer pointer) throws IOException, InvalidMessageException {
|
private File retrieveAttachment(SignalServiceAttachmentPointer pointer) throws IOException, InvalidMessageException {
|
||||||
IOUtils.createPrivateDirectories(attachmentsPath);
|
IOUtils.createPrivateDirectories(attachmentsPath);
|
||||||
return retrieveAttachment(pointer, getAttachmentFile(pointer.getId()), true);
|
return retrieveAttachment(pointer, getAttachmentFile(pointer.getId()), true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue