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