diff --git a/src/controllers/message/MessageController.ts b/src/controllers/message/MessageController.ts index dfec88a..206576d 100644 --- a/src/controllers/message/MessageController.ts +++ b/src/controllers/message/MessageController.ts @@ -110,10 +110,13 @@ export class MessageController { fileName: item.filename, metadata: { preview: item.preview, + width: item.width, + height: item.height, duration: item.duration, title: item.title, icon: item.icon, openingMode: item.openingMode, + screenOrientation: item.screenOrientation, }, })), }) diff --git a/src/events/MessageEvents.ts b/src/events/MessageEvents.ts index 70b814d..bc353b2 100644 --- a/src/events/MessageEvents.ts +++ b/src/events/MessageEvents.ts @@ -268,6 +268,14 @@ export const messageEvents = async (agent: ServiceAgent, config: ServerConfig) = byteCount: item.byteCount, description: item.description, filename: item.fileName, + duration: item.metadata?.duration as string, + preview: item.metadata?.preview as string, + width: item.metadata?.width as number, + height: item.metadata?.height as number, + title: item.metadata?.title as string, + icon: item.metadata?.icon as string, + openingMode: item.metadata?.openingMode as string, + screenOrientation: item.metadata?.screenOrientation as string, })), }) diff --git a/src/model/messages/MediaMessage.ts b/src/model/messages/MediaMessage.ts index 7f04606..a319733 100644 --- a/src/model/messages/MediaMessage.ts +++ b/src/model/messages/MediaMessage.ts @@ -19,10 +19,13 @@ export interface MediaItemOptions { uri: string ciphering?: CipheringInfo preview?: string + width?: number + height?: number duration?: string title?: string icon?: string openingMode?: string + screenOrientaton?: string } export class MediaItem { @@ -36,10 +39,13 @@ export class MediaItem { this.uri = options.uri this.ciphering = options.ciphering this.preview = options.preview + this.width = options.width + this.height = options.height this.duration = options.duration this.title = options.title this.icon = options.icon this.openingMode = options.openingMode + this.screenOrientation = options.screenOrientaton } } @@ -68,6 +74,12 @@ export class MediaItem { @IsString() public preview?: string + @IsOptional() + public width?: number + + @IsOptional() + public height?: number + @IsOptional() @IsString() public duration?: string @@ -84,6 +96,10 @@ export class MediaItem { @IsString() public openingMode?: string + @IsOptional() + @IsString() + public screenOrientation?: string + @IsOptional() public ciphering?: CipheringInfo }