Add support for more file formats

This commit is contained in:
2025-11-28 17:37:30 +01:00
parent c360432911
commit 62966473f0
4 changed files with 65 additions and 9 deletions

View File

@@ -3,6 +3,7 @@ import type {
MatrixEvent,
MatrixEventData,
MatrixEventsList,
MessageType,
} from "../api/matrix/MatrixApiEvent";
import type { Room } from "../api/matrix/MatrixApiRoom";
import type { WsMessage } from "../api/WsApi";
@@ -21,7 +22,8 @@ export interface Message {
modified: boolean;
reactions: Map<string, MessageReaction[]>;
content: string;
image?: string;
type: MessageType;
file?: string;
}
export class RoomEventsManager {
@@ -141,7 +143,8 @@ export class RoomEventsManager {
reactions: new Map(),
time_sent: evt.time,
time_sent_dayjs: dayjs.unix(evt.time / 1000),
image: data.content.file?.url ?? data.content.url,
type: data.content.msgtype,
file: data.content.file?.url ?? data.content.url,
content: data.content.body,
});
}