Rendering location messages in the timeline.

This commit is contained in:
Stefan Ceriu
2021-12-10 17:49:08 +02:00
committed by Stefan Ceriu
parent a40af4fa80
commit 7f9e294d82
29 changed files with 493 additions and 41 deletions
@@ -3668,9 +3668,6 @@
MXLogDebug(@"[MXKRoomVC] showAttachmentInCell on an unsent media");
}
}
else if (selectedAttachment.type == MXKAttachmentTypeLocation)
{
}
else if (selectedAttachment.type == MXKAttachmentTypeFile || selectedAttachment.type == MXKAttachmentTypeAudio)
{
// Start activity indicator as feedback on file selection.
@@ -33,7 +33,6 @@ typedef enum : NSUInteger {
MXKAttachmentTypeAudio,
MXKAttachmentTypeVoiceMessage,
MXKAttachmentTypeVideo,
MXKAttachmentTypeLocation,
MXKAttachmentTypeFile,
MXKAttachmentTypeSticker
@@ -109,12 +109,6 @@ NSString *const kMXKAttachmentFileNameBase = @"attatchment";
_type = MXKAttachmentTypeVideo;
MXJSONModelSetDictionary(_thumbnailInfo, eventContent[@"info"][@"thumbnail_info"]);
}
else if ([msgtype isEqualToString:kMXMessageTypeLocation])
{
// Not supported yet
// _type = MXKAttachmentTypeLocation;
return nil;
}
else if ([msgtype isEqualToString:kMXMessageTypeFile])
{
_type = MXKAttachmentTypeFile;
@@ -102,7 +102,7 @@ static NSAttributedString *messageSeparator = nil;
return NO;
}
}
// Add all components of the provided message
for (MXKRoomBubbleComponent* component in cellData.bubbleComponents)
{
@@ -175,10 +175,6 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=\"(.*?)\">([^<]*)</a>";
{
isSupportedAttachment = hasUrl || hasFile;
}
else if ([msgtype isEqualToString:kMXMessageTypeLocation])
{
// Not supported yet
}
else if ([msgtype isEqualToString:kMXMessageTypeFile])
{
isSupportedAttachment = hasUrl || hasFile;
@@ -1333,23 +1329,6 @@ static NSString *const kHTMLATagRegexPattern = @"<a href=\"(.*?)\">([^<]*)</a>";
*error = MXKEventFormatterErrorUnsupported;
}
}
else if ([msgtype isEqualToString:kMXMessageTypeLocation])
{
body = body? body : [MatrixKitL10n noticeLocationAttachment];
if (![self isSupportedAttachment:event])
{
MXLogDebug(@"[MXKEventFormatter] Warning: Unsupported attachment %@", event.description);
if (_isForSubtitle || !_settings.showUnsupportedEventsInRoomHistory)
{
body = [MatrixKitL10n noticeInvalidAttachment];
}
else
{
body = [MatrixKitL10n noticeUnsupportedAttachment:event.description];
}
*error = MXKEventFormatterErrorUnsupported;
}
}
else if ([msgtype isEqualToString:kMXMessageTypeFile])
{
body = body? body : [MatrixKitL10n noticeFileAttachment];