Update Files component iOS (#6345)

* Update Files component iOS

- Done
This commit is contained in:
Gil Eluard
2022-06-29 16:11:52 +02:00
committed by GitHub
parent ddd7ff625a
commit 038c347fc9
11 changed files with 221 additions and 49 deletions
@@ -1356,9 +1356,22 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=(?:'|\")(.*?)(?:'|\")>(
}
else if ([msgtype isEqualToString:kMXMessageTypeFile])
{
body = body? body : [VectorL10n noticeFileAttachment];
// Check attachment validity
if (![self isSupportedAttachment:event])
if ([self isSupportedAttachment:event])
{
body = body? body : [VectorL10n noticeFileAttachment];
NSDictionary *fileInfo = contentToUse[@"info"];
if (fileInfo)
{
NSNumber *fileSize = fileInfo[@"size"];
if (fileSize)
{
body = [NSString stringWithFormat:@"%@ (%@)", body, [MXTools fileSizeToString: fileSize.longValue]];
}
}
}
else
{
MXLogDebug(@"[MXKEventFormatter] Warning: Unsupported attachment %@", event.description);
body = [VectorL10n noticeInvalidAttachment];