Stop audio on redaction (#1893)

This commit is contained in:
Alfonso Grillo
2023-10-16 10:22:09 +02:00
committed by GitHub
parent b06a8a857a
commit a8de32c034

View File

@@ -379,7 +379,16 @@ class RoomTimelineController: RoomTimelineControllerProtocol {
if timelineItem is EncryptedHistoryRoomTimelineItem {
lastEncryptedHistoryItemIndex = newTimelineItems.endIndex
}
// Stops the audio player when a voice message is redacted.
if timelineItem is RedactedRoomTimelineItem {
guard let audioState = timelineAudioPlayerStates[timelineItem.id] else {
continue
}
audioState.detachAudioPlayer()
timelineAudioPlayerStates.removeValue(forKey: timelineItem.id)
}
newTimelineItems.append(timelineItem)
} else {
newTimelineItems.append(CollapsibleTimelineItem(items: items))