Обновление протокола вложений

This commit is contained in:
RoyceDa
2026-03-27 15:58:16 +02:00
parent 7e0e97f472
commit 94ba139541
8 changed files with 56 additions and 35 deletions

View File

@@ -30,7 +30,7 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp
const uploadedPercentage = useUploadStatus(attachment.id);
const downloadPercentage = useDownloadStatus(attachment.id);
const [downloadStatus, setDownloadStatus] = useMemory("attachment-downloaded-status-" + attachment.id, DownloadStatus.PENDING, true);
const [downloadTag, setDownloadTag] = useState(attachment.transport_tag || "");
const [downloadTag, setDownloadTag] = useState(attachment.transport.transport_tag || "");
const {readFile, writeFile, fileExists, size} = useFileStorage();
const { downloadFile } = useTransport();
const publicKey = usePublicKey();
@@ -56,7 +56,7 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp
if (downloadStatus == DownloadStatus.DOWNLOADED) {
return;
}
if(attachment.transport_tag == ""){
if(attachment.transport.transport_tag == ""){
/**
* Транспортного тега нет только у сообщений отправленных нами, значит он точно наш
*/
@@ -130,7 +130,7 @@ export function useAttachment(attachment: Attachment, parentMessage: MessageProp
let downloadedBlob = '';
try {
downloadedBlob = await downloadFile(attachment.id,
downloadTag, attachment.transport_server);
downloadTag, attachment.transport.transport_server);
} catch (e) {
console.info(e);
info("Error downloading attachment: " + attachment.id);