Add support for unencrypted media
This commit is contained in:
@@ -217,8 +217,6 @@ pub async fn event_file(
|
|||||||
_ => (None, None),
|
_ => (None, None),
|
||||||
};
|
};
|
||||||
|
|
||||||
println!("{source:#?} {thumb_source:#?}");
|
|
||||||
|
|
||||||
let source = match (query.thumbnail, source, thumb_source) {
|
let source = match (query.thumbnail, source, thumb_source) {
|
||||||
(false, Some(s), _) => s,
|
(false, Some(s), _) => s,
|
||||||
(true, _, Some(s)) => s,
|
(true, _, Some(s)) => s,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ export interface RoomMessageEvent extends BaseRoomEvent {
|
|||||||
msgtype?: MessageType;
|
msgtype?: MessageType;
|
||||||
body?: string;
|
body?: string;
|
||||||
};
|
};
|
||||||
|
url?: string;
|
||||||
file?: { url: string };
|
file?: { url: string };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ export interface MatrixRoomMessage {
|
|||||||
event_id: string;
|
event_id: string;
|
||||||
rel_type: "m.replace" | string;
|
rel_type: "m.replace" | string;
|
||||||
};
|
};
|
||||||
|
url?: string;
|
||||||
file?: {
|
file?: {
|
||||||
url: string;
|
url: string;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ export class RoomEventsManager {
|
|||||||
rel_type: m.data["m.relates_to"].rel_type ?? "",
|
rel_type: m.data["m.relates_to"].rel_type ?? "",
|
||||||
}
|
}
|
||||||
: undefined,
|
: undefined,
|
||||||
|
url: m.data.url,
|
||||||
file: m.data.file,
|
file: m.data.file,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
@@ -140,7 +141,7 @@ export class RoomEventsManager {
|
|||||||
reactions: new Map(),
|
reactions: new Map(),
|
||||||
time_sent: evt.time,
|
time_sent: evt.time,
|
||||||
time_sent_dayjs: dayjs.unix(evt.time / 1000),
|
time_sent_dayjs: dayjs.unix(evt.time / 1000),
|
||||||
image: data.content.file?.url,
|
image: data.content.file?.url ?? data.content.url,
|
||||||
content: data.content.body,
|
content: data.content.body,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user