Add voice broadcast state event (#6785)

This commit is contained in:
Yoan Pintas
2022-10-12 11:30:38 +02:00
committed by GitHub
parent b05160e221
commit 98aae7f667
17 changed files with 781 additions and 101 deletions
+47 -33
View File
@@ -182,6 +182,13 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
// Show timestamps always on right
self.displayTimestampForSelectedComponentOnLeftWhenPossible = NO;
}
} else if ([event.type isEqualToString:VoiceBroadcastSettings.eventType]) {
self.tag = RoomBubbleCellDataTagVoiceBroadcast;
self.collapsable = NO;
self.collapsed = NO;
MXLogDebug(@"VB incoming initWithEvent")
break;
}
break;
@@ -271,42 +278,44 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
- (BOOL)hasNoDisplay
{
if (self.tag == RoomBubbleCellDataTagKeyVerificationNoDisplay)
BOOL hasNoDisplay = YES;
switch (self.tag)
{
return YES;
case RoomBubbleCellDataTagKeyVerificationNoDisplay:
hasNoDisplay = YES;
break;
case RoomBubbleCellDataTagRoomCreationIntro:
hasNoDisplay = NO;
break;
case RoomBubbleCellDataTagPoll:
if (self.events.lastObject.isEditEvent) {
hasNoDisplay = YES;
}
hasNoDisplay = NO;
break;
case RoomBubbleCellDataTagLocation:
hasNoDisplay = NO;
break;
case RoomBubbleCellDataTagLiveLocation:
// If the summary does not exist don't show the cell
if (!self.beaconInfoSummary)
{
hasNoDisplay = YES;
}
hasNoDisplay = NO;
break;
case RoomBubbleCellDataTagVoiceBroadcast:
hasNoDisplay = YES;
break;
default:
hasNoDisplay = [super hasNoDisplay];
break;
}
if (self.tag == RoomBubbleCellDataTagRoomCreationIntro)
{
return NO;
}
if (self.tag == RoomBubbleCellDataTagPoll)
{
if (self.events.lastObject.isEditEvent) {
return YES;
}
return NO;
}
if (self.tag == RoomBubbleCellDataTagLocation)
{
return NO;
}
if (self.tag == RoomBubbleCellDataTagLiveLocation)
{
// If the summary does not exist don't show the cell
if (!self.beaconInfoSummary)
{
return YES;
}
return NO;
}
return [super hasNoDisplay];
return hasNoDisplay;
}
- (BOOL)hasThreadRoot
@@ -1050,6 +1059,9 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
case RoomBubbleCellDataTagLiveLocation:
shouldAddEvent = NO;
break;
case RoomBubbleCellDataTagVoiceBroadcast:
shouldAddEvent = NO;
break;
default:
break;
}
@@ -1118,6 +1130,8 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
{
shouldAddEvent = NO;
}
} else if ([event.type isEqualToString:VoiceBroadcastSettings.eventType]) {
shouldAddEvent = NO;
}
break;
}