Add support for more file formats
This commit is contained in:
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user