Update files following swiftformat upgrade

This commit is contained in:
Stefan Ceriu
2026-01-27 08:47:03 +02:00
committed by Stefan Ceriu
parent fe189fcfed
commit 23062901c0
343 changed files with 1502 additions and 1048 deletions
@@ -47,7 +47,7 @@ struct GeoURI: Hashable {
// MARK: - Private
// Parse a geo URI string like "geo:53.99803101552848,-8.25347900390625;u=10"
/// Parse a geo URI string like "geo:53.99803101552848,-8.25347900390625;u=10"
private static func parseGeoURI(from string: String) -> GeoURI? {
guard
let matchOutput = try? RegexGeoURI.standard.wholeMatch(in: string)?.output,
@@ -7,7 +7,6 @@
//
import Foundation
import MatrixRustSDK
import WysiwygComposer
@@ -21,7 +21,10 @@ class MockTimelineController: TimelineControllerProtocol {
var roomProxy: JoinedRoomProxyProtocol?
var timelineProxy: TimelineProxyProtocol?
var roomID: String { roomProxy?.id ?? "MockRoomIdentifier" }
var roomID: String {
roomProxy?.id ?? "MockRoomIdentifier"
}
var timelineKind: TimelineKind
let callbacks = PassthroughSubject<TimelineControllerCallback, Never>()
@@ -250,8 +250,8 @@ class TimelineController: TimelineControllerProtocol {
await activeTimeline.messageEventContent(for: timelineItemID)
}
// Handle this parallel to the timeline items so we're not forced
// to bundle the Rust side objects within them
/// Handle this parallel to the timeline items so we're not forced
/// to bundle the Rust side objects within them
func debugInfo(for itemID: TimelineItemIdentifier) -> TimelineItemDebugInfo {
for timelineItemProxy in activeTimelineItemProvider.itemProxies {
switch timelineItemProxy {
@@ -428,14 +428,12 @@ class TimelineController: TimelineControllerProtocol {
let isLastItem = index == collapsibleChunks.indices.last
let items = collapsibleChunk.compactMap { itemProxy in
let timelineItem = self.buildTimelineItem(for: itemProxy,
isDM: isDM,
hasPredecessor: hasPredecessor,
roomDisplayName: displayName,
timelineItemFactory: timelineItemFactory,
activeTimeline: activeTimeline)
return timelineItem
self.buildTimelineItem(for: itemProxy,
isDM: isDM,
hasPredecessor: hasPredecessor,
roomDisplayName: displayName,
timelineItemFactory: timelineItemFactory,
activeTimeline: activeTimeline)
}
if items.isEmpty {
@@ -14,5 +14,7 @@ struct ReadReceipt: Hashable {
}
extension ReadReceipt: Identifiable {
var id: String { userID }
var id: String {
userID
}
}
@@ -10,11 +10,11 @@ import Foundation
/// Properties of a matrix event that are common between all timeline items.
struct RoomTimelineItemProperties: Hashable {
// Information on the item this one replying to
/// Information on the item this one replying to
var replyDetails: TimelineItemReplyDetails?
// Whether it's part of a thread or not
/// Whether it's part of a thread or not
var isThreaded = false
// Information about the thread this message is the root of, if any
/// Information about the thread this message is the root of, if any
var threadSummary: TimelineItemThreadSummary?
/// Whether the item has been edited.
var isEdited = false
@@ -624,7 +624,7 @@ struct RoomTimelineItemFactory: RoomTimelineItemFactoryProtocol {
return .init(body: messageContent.body, formattedBody: formattedBody, formattedBodyHTMLString: htmlBody)
}
// This fixes the issue of the name not belonging to the first <p> defined paragraph
/// This fixes the issue of the name not belonging to the first <p> defined paragraph
private func buildEmoteFormattedBodyFromHTML(html: String, name: String) -> AttributedString? {
let htmlBodyPlaceholder = "{htmlBodyPlaceholder}"
var finalString = AttributedString(L10n.commonEmote(name, htmlBodyPlaceholder))
@@ -7,7 +7,6 @@
//
import Foundation
import MatrixRustSDK
protocol RoomTimelineItemFactoryProtocol {
@@ -1,4 +1,6 @@
//
import OrderedCollections
// Copyright 2025 Element Creations Ltd.
// Copyright 2022-2025 New Vector Ltd.
//
@@ -7,8 +9,6 @@
//
import SwiftUI
import OrderedCollections
struct RoomTimelineItemView: View {
@Environment(\.timelineContext) var context
@ObservedObject var viewState: RoomTimelineItemViewState