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 f2dea3f2ec
commit c1a3fede8f
29 changed files with 493 additions and 41 deletions
@@ -174,8 +174,17 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
self.displayTimestampForSelectedComponentOnLeftWhenPossible = NO;
}
}
}
break;
}
case MXEventTypeRoomMessage:
{
if (event.hasLocation) {
self.tag = RoomBubbleCellDataTagLocation;
self.collapsable = NO;
self.collapsed = NO;
}
}
default:
break;
}
@@ -273,6 +282,11 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
return NO;
}
if (self.tag == RoomBubbleCellDataTagLocation)
{
return NO;
}
return [super hasNoDisplay];
}
@@ -845,6 +859,9 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
case RoomBubbleCellDataTagPoll:
shouldAddEvent = NO;
break;
case RoomBubbleCellDataTagLocation:
shouldAddEvent = NO;
break;
default:
break;
}
@@ -857,6 +874,11 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
{
case MXEventTypeRoomMessage:
{
if (event.hasLocation) {
shouldAddEvent = NO;
break;
}
NSString *messageType = event.content[@"msgtype"];
if ([messageType isEqualToString:kMXMessageTypeKeyVerificationRequest])
@@ -1075,9 +1097,6 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
case MXKAttachmentTypeVideo:
accessibilityLabel = [VectorL10n mediaTypeAccessibilityVideo];
break;
case MXKAttachmentTypeLocation:
accessibilityLabel = [VectorL10n mediaTypeAccessibilityLocation];
break;
case MXKAttachmentTypeFile:
accessibilityLabel = [VectorL10n mediaTypeAccessibilityFile];
break;