@@ -638,6 +638,35 @@ describe("MatrixEventProcessor", () => {
638
638
} as IMatrixEvent , mockChannel as any ) ;
639
639
expect ( embeds . messageEmbed . description ) . to . equal ( "Bunnies\n(<@1234>)" ) ;
640
640
} ) ;
641
+ it ( "Should not send filename in body" , async ( ) => {
642
+ const { processor} = createMatrixEventProcessor ( ) ;
643
+ const embeds = await processor . EventToEmbed ( {
644
+ content : {
645
+ body : "filename.zip" ,
646
+ msgtype : "m.file" ,
647
+ url : "mxc://file" ,
648
+ } ,
649
+ sender : "@test:localhost" ,
650
+ type : "m.room.member" ,
651
+ } as IMatrixEvent , mockChannel as any ) ;
652
+ expect ( embeds . messageEmbed . description ) . to . equal ( "" ) ;
653
+ } ) ;
654
+ it ( "Should not send image filename in body" , async ( ) => {
655
+ const { processor} = createMatrixEventProcessor ( ) ;
656
+ const embeds = await processor . EventToEmbed ( {
657
+ content : {
658
+ body : "filename.jpg" ,
659
+ info : {
660
+ mimetype : "image/jpeg" ,
661
+ } ,
662
+ msgtype : "m.image" ,
663
+ url : "mxc://image" ,
664
+ } ,
665
+ sender : "@test:localhost" ,
666
+ type : "m.room.member" ,
667
+ } as IMatrixEvent , mockChannel as any ) ;
668
+ expect ( embeds . messageEmbed . description ) . to . equal ( "" ) ;
669
+ } ) ;
641
670
} ) ;
642
671
describe ( "HandleAttachment" , ( ) => {
643
672
const SMALL_FILE = 200 ;
@@ -939,7 +968,7 @@ This is the reply`,
939
968
type : "m.room.message" ,
940
969
} as IMatrixEvent , mockChannel as any ) ;
941
970
expect ( result ! . image ! . url ! ) . to . be . equal ( "https://fox/localhost" ) ;
942
- expect ( result ! . description ) . to . be . equal ( "fox.jpg " ) ;
971
+ expect ( result ! . description ) . to . be . equal ( "" ) ;
943
972
} ) ;
944
973
it ( "should handle replies to files" , async ( ) => {
945
974
const { processor} = createMatrixEventProcessor ( ) ;
0 commit comments