From ed27aa9a47da6d4e04839f2dff9a00bf0333ba91 Mon Sep 17 00:00:00 2001 From: Alfonso Grillo Date: Thu, 20 Jul 2023 15:04:13 +0200 Subject: [PATCH] Location event body representation (#1368) * Change GeoURI body format * Update location event representation --- ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift | 2 +- .../Services/Room/RoomSummary/RoomEventStringBuilder.swift | 2 ++ .../TimelineItems/Items/Messages/LocationRoomTimelineItem.swift | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift index 30a204124..d0d3f74f3 100644 --- a/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift +++ b/ElementX/Sources/FlowCoordinators/RoomFlowCoordinator.swift @@ -675,6 +675,6 @@ private extension RoomFlowCoordinator { private extension GeoURI { var bodyMessage: String { - String(format: "Location was shared at %@ as of %@", string, Date().description) + "Location was shared at \(string)" } } diff --git a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift index 4841edcd4..ebf7882b5 100644 --- a/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift +++ b/ElementX/Sources/Services/Room/RoomSummary/RoomEventStringBuilder.swift @@ -53,6 +53,8 @@ struct RoomEventStringBuilder { message = L10n.commonVideo case .file: message = L10n.commonFile + case .location: + message = L10n.commonSharedLocation default: message = messageContent.body() } diff --git a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift index a0cd6463c..2bb1b92a2 100644 --- a/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift +++ b/ElementX/Sources/Services/Timeline/TimelineItems/Items/Messages/LocationRoomTimelineItem.swift @@ -26,7 +26,7 @@ struct LocationRoomTimelineItem: EventBasedMessageTimelineItemProtocol, Equatabl let content: LocationRoomTimelineItemContent var body: String { - content.body + L10n.commonSharedLocation } var replyDetails: TimelineItemReplyDetails?