vector-im/element-ios/issues/5114 - Polls in the timeline.

This commit is contained in:
Stefan Ceriu
2021-11-19 17:40:52 +02:00
parent ef4abe6ed2
commit ac6561a3d3
47 changed files with 1717 additions and 223 deletions
@@ -149,6 +149,15 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
// Show timestamps always on right
self.displayTimestampForSelectedComponentOnLeftWhenPossible = NO;
break;
}
case MXEventTypePollStart:
{
self.tag = RoomBubbleCellDataTagPoll;
self.collapsable = NO;
self.collapsed = NO;
break;
}
case MXEventTypeCustom:
{
@@ -259,6 +268,11 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
return NO;
}
if (self.tag == RoomBubbleCellDataTagPoll)
{
return NO;
}
return [super hasNoDisplay];
}
@@ -417,7 +431,9 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
{
__block NSInteger firstVisibleComponentIndex = NSNotFound;
if (self.attachment && self.bubbleComponents.count)
BOOL isPoll = (self.events.firstObject.eventType == MXEventTypePollStart);
if ((isPoll || self.attachment) && self.bubbleComponents.count)
{
firstVisibleComponentIndex = 0;
}
@@ -873,6 +889,9 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
case MXEventTypeCallReject:
shouldAddEvent = NO;
break;
case MXEventTypePollStart:
shouldAddEvent = NO;
break;
case MXEventTypeCustom:
{
if ([event.type isEqualToString:kWidgetMatrixEventTypeString]