diff --git a/Riot/Model/Search/FilesSearchCellData.m b/Riot/Model/Search/FilesSearchCellData.m index 03ba0b808..f8803ff79 100644 --- a/Riot/Model/Search/FilesSearchCellData.m +++ b/Riot/Model/Search/FilesSearchCellData.m @@ -38,6 +38,13 @@ // Title is here the file name stored in event body title = [event.content[@"body"] isKindOfClass:[NSString class]] ? event.content[@"body"] : nil; + // Check attachment if any + if ([searchDataSource.eventFormatter isSupportedAttachment:event]) + { + // Note: event.eventType is equal here to MXEventTypeRoomMessage + attachment = [[MXKAttachment alloc] initWithEvent:event andMatrixSession:searchDataSource.mxSession]; + } + // Append the file size if any if (attachment.contentInfo[@"size"]) {