From 0c6a14f079c05d3010c8a35f9eb9fc17b248c198 Mon Sep 17 00:00:00 2001 From: ismailgulek Date: Fri, 25 Sep 2020 16:16:23 +0300 Subject: [PATCH] Hide room creation event in modal --- .../RoomCreationEventsModalViewModel.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModel.swift b/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModel.swift index 1f30869cd..3757ae759 100644 --- a/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModel.swift +++ b/Riot/Modules/Room/CreationModal/RoomCreationEventsModal/RoomCreationEventsModalViewModel.swift @@ -112,9 +112,14 @@ final class RoomCreationEventsModalViewModel: RoomCreationEventsModalViewModelTy events.append(contentsOf: bubbleData.events) var nextBubbleData = bubbleData.nextCollapsableCellData while nextBubbleData != nil { + // swiftlint:disable force_unwrapping events.append(contentsOf: nextBubbleData!.events) + // swiftlint:enable force_unwrapping nextBubbleData = nextBubbleData?.nextCollapsableCellData } + + // remove room create event from the list, as EW and ElA do. This will also avoid duplication of "%@ joined" messages for direct rooms. + events.removeAll(where: { $0.eventType == .roomCreate }) } // MARK: - Public