[Voice Broadcast] Aggregate the chunks of voice messages in room timeline (#6891)

This commit is contained in:
Yoan Pintas
2022-10-17 18:23:47 +02:00
committed by GitHub
parent bed02f8bc9
commit 58551e04c1
42 changed files with 1230 additions and 55 deletions
@@ -182,7 +182,9 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
// Show timestamps always on right
self.displayTimestampForSelectedComponentOnLeftWhenPossible = NO;
}
} else if ([event.type isEqualToString:VoiceBroadcastSettings.eventType]) {
}
else if ([event.type isEqualToString:VoiceBroadcastSettings.eventType])
{
self.tag = RoomBubbleCellDataTagVoiceBroadcast;
self.collapsable = NO;
self.collapsed = NO;
@@ -195,11 +197,18 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
}
case MXEventTypeRoomMessage:
{
if (event.location) {
if (event.location)
{
self.tag = RoomBubbleCellDataTagLocation;
self.collapsable = NO;
self.collapsed = NO;
}
else if (event.content[VoiceBroadcastSettings.voiceBroadcastContentKeyChunkType])
{
self.tag = RoomBubbleCellDataTagVoiceBroadcast;
self.collapsable = NO;
self.collapsed = NO;
}
break;
}
@@ -307,7 +316,12 @@ NSString *const URLPreviewDidUpdateNotification = @"URLPreviewDidUpdateNotificat
break;
case RoomBubbleCellDataTagVoiceBroadcast:
hasNoDisplay = YES;
if (RiotSettings.shared.enableVoiceBroadcast == YES &&
[VoiceBroadcastInfo isStartedFor:[VoiceBroadcastInfo modelFromJSON:self.events.lastObject.content].state])
{
hasNoDisplay = NO;
}
break;
default:
hasNoDisplay = [super hasNoDisplay];