Removing dead code part 2 (#2235)

Co-authored-by: Doug <6060466+pixlwave@users.noreply.github.com>
This commit is contained in:
Mauro
2023-12-15 20:16:16 +01:00
committed by GitHub
parent 2f88d39789
commit 123164f398
91 changed files with 64 additions and 694 deletions
@@ -22,10 +22,6 @@ import WysiwygComposer
struct IntentionalMentions: Equatable {
let userIDs: Set<String>
let atRoom: Bool
static var empty: Self {
IntentionalMentions(userIDs: [], atRoom: false)
}
}
extension IntentionalMentions {
@@ -14,15 +14,14 @@
// limitations under the License.
//
// periphery:ignore:all
import Combine
import Foundation
class MockRoomTimelineController: RoomTimelineControllerProtocol {
/// An array of timeline item arrays that will be inserted in order for each back pagination request.
var backPaginationResponses: [[RoomTimelineItemProtocol]] = []
/// The time delay added to each back pagination request.
var backPaginationDelay: Duration = .milliseconds(500)
/// An array of timeline items that will be appended in order when ``simulateIncomingItems()`` is called.
var incomingItems: [RoomTimelineItemProtocol] = []
@@ -18,23 +18,12 @@ struct LocationRoomTimelineItemContent: Hashable {
let body: String
let geoURI: GeoURI?
let description: String?
let zoomLevel: UInt8?
let asset: AssetType?
enum AssetType {
case sender
case pin
}
init(body: String,
geoURI: GeoURI? = nil,
description: String? = nil,
zoomLevel: UInt8? = nil,
asset: AssetType? = nil) {
description: String? = nil) {
self.body = body
self.geoURI = geoURI
self.description = description
self.zoomLevel = zoomLevel
self.asset = asset
}
}
@@ -121,7 +121,7 @@ struct RoomStateEventStringBuilder {
}
}
func buildString(for state: OtherState, stateKey: String?, sender: TimelineItemSender, isOutgoing: Bool) -> String? {
func buildString(for state: OtherState, sender: TimelineItemSender, isOutgoing: Bool) -> String? {
let senderName = sender.displayName ?? sender.id
switch state {
@@ -526,9 +526,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
private func buildLocationTimelineItemContent(_ locationContent: LocationContent) -> LocationRoomTimelineItemContent {
LocationRoomTimelineItemContent(body: locationContent.body,
geoURI: .init(string: locationContent.geoUri),
description: locationContent.description,
zoomLevel: locationContent.zoomLevel,
asset: locationContent.asset.map { .init(assetType: $0) })
description: locationContent.description)
}
private func buildFileTimelineItemContent(_ messageContent: FileMessageContent) -> FileRoomTimelineItemContent {
@@ -568,7 +566,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
state: OtherState,
stateKey: String,
isOutgoing: Bool) -> RoomTimelineItemProtocol? {
guard let text = stateEventStringBuilder.buildString(for: state, stateKey: stateKey, sender: eventItemProxy.sender, isOutgoing: isOutgoing) else { return nil }
guard let text = stateEventStringBuilder.buildString(for: state, sender: eventItemProxy.sender, isOutgoing: isOutgoing) else { return nil }
return buildStateTimelineItem(for: eventItemProxy, text: text, isOutgoing: isOutgoing)
}
@@ -680,17 +678,6 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
}
}
private extension LocationRoomTimelineItemContent.AssetType {
init(assetType: MatrixRustSDK.AssetType) {
switch assetType {
case .sender:
self = .sender
case .pin:
self = .pin
}
}
}
extension Poll.Kind {
init(pollKind: MatrixRustSDK.PollKind) {
switch pollKind {