Новая система вложений
This commit is contained in:
@@ -46,6 +46,9 @@ export interface AttachmentMeta {
|
||||
id: string;
|
||||
type: AttachmentType;
|
||||
preview: string;
|
||||
transport_tag: string;
|
||||
encoded_for: string;
|
||||
transport_server: string;
|
||||
}
|
||||
|
||||
export interface Message {
|
||||
@@ -469,9 +472,7 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
for(let i = 0; i < packet.getAttachments().length; i++) {
|
||||
const attachment = packet.getAttachments()[i];
|
||||
attachments.push({
|
||||
id: attachment.id,
|
||||
preview: attachment.preview,
|
||||
type: attachment.type,
|
||||
...attachment,
|
||||
blob: attachment.type == AttachmentType.MESSAGES ? await decodeWithPassword(chachaDecryptedKey.toString('utf-8'), attachment.blob) : ""
|
||||
});
|
||||
}
|
||||
@@ -549,9 +550,7 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
for(let i = 0; i < packet.getAttachments().length; i++) {
|
||||
const attachment = packet.getAttachments()[i];
|
||||
attachments.push({
|
||||
id: attachment.id,
|
||||
preview: attachment.preview,
|
||||
type: attachment.type,
|
||||
...attachment,
|
||||
blob: attachment.type == AttachmentType.MESSAGES ? await decodeWithPassword(groupKey, attachment.blob) : ""
|
||||
});
|
||||
}
|
||||
@@ -627,9 +626,7 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
for(let i = 0; i < packet.getAttachments().length; i++) {
|
||||
const attachment = packet.getAttachments()[i];
|
||||
attachments.push({
|
||||
id: attachment.id,
|
||||
preview: attachment.preview,
|
||||
type: attachment.type,
|
||||
...attachment,
|
||||
blob: attachment.type == AttachmentType.MESSAGES ? await decodeWithPassword(chachaDecryptedKey.toString('utf-8'), attachment.blob) : ""
|
||||
});
|
||||
}
|
||||
@@ -707,9 +704,7 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
for(let i = 0; i < packet.getAttachments().length; i++) {
|
||||
const attachment = packet.getAttachments()[i];
|
||||
attachments.push({
|
||||
id: attachment.id,
|
||||
preview: attachment.preview,
|
||||
type: attachment.type,
|
||||
...attachment,
|
||||
blob: attachment.type == AttachmentType.MESSAGES ? await decodeWithPassword(groupKey, attachment.blob) : ""
|
||||
});
|
||||
}
|
||||
@@ -964,7 +959,10 @@ export function DialogProvider(props: DialogProviderProps) {
|
||||
id: meta.id,
|
||||
blob: blob,
|
||||
type: meta.type,
|
||||
preview: meta.preview
|
||||
preview: meta.preview,
|
||||
transport_server: meta.transport_server,
|
||||
transport_tag: meta.transport_tag,
|
||||
encoded_for: meta.encoded_for
|
||||
});
|
||||
}
|
||||
return attachments;
|
||||
|
||||
Reference in New Issue
Block a user