From 30346989c2024473e64a114c786b55544e1e1ac0 Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Mon, 18 Jul 2022 15:45:37 +0200 Subject: [PATCH 1/4] Live location sharing: Update timeline reply string. --- Riot/Assets/en.lproj/Vector.strings | 2 +- Riot/Generated/Strings.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 399f23632..d30598320 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -2520,7 +2520,7 @@ To enable access, tap Settings> Location and select Always"; "message_reply_to_sender_sent_a_voice_message" = "sent a voice message."; "message_reply_to_sender_sent_a_file" = "sent a file."; "message_reply_to_sender_sent_their_location" = "has shared their location."; -"message_reply_to_sender_sent_their_live_location" = "has shared their live location."; +"message_reply_to_sender_sent_their_live_location" = "Live location."; "message_reply_to_message_to_reply_to_prefix" = "In reply to"; // Room members diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index 31326f972..86b87d7dc 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -3415,7 +3415,7 @@ public class VectorL10n: NSObject { public static var messageReplyToSenderSentAnImage: String { return VectorL10n.tr("Vector", "message_reply_to_sender_sent_an_image") } - /// has shared their live location. + /// Live location. public static var messageReplyToSenderSentTheirLiveLocation: String { return VectorL10n.tr("Vector", "message_reply_to_sender_sent_their_live_location") } From 023e1f3bdb30d9f856ebcfd379d1dbfdcf3764e1 Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Mon, 18 Jul 2022 15:47:05 +0200 Subject: [PATCH 2/4] RoomVC: Updated supported context menu actions for beacon info event. --- Riot/Modules/Room/RoomViewController.m | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 26dd78547..cf4b80b8c 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -3683,7 +3683,8 @@ static CGSize kThreadListBarButtonItemImageSize; }]]; } - if (!isJitsiCallEvent && selectedEvent.eventType != MXEventTypePollStart) + if (!isJitsiCallEvent && selectedEvent.eventType != MXEventTypePollStart && + selectedEvent.eventType != MXEventTypeBeaconInfo) { [self.eventMenuBuilder addItemWithType:EventMenuItemTypeQuote action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionQuote] @@ -3719,7 +3720,8 @@ static CGSize kThreadListBarButtonItemImageSize; }]]; } - if (!isJitsiCallEvent && BuildSettings.messageDetailsAllowShare && selectedEvent.eventType != MXEventTypePollStart) + if (!isJitsiCallEvent && BuildSettings.messageDetailsAllowShare && selectedEvent.eventType != MXEventTypePollStart && + selectedEvent.eventType != MXEventTypeBeaconInfo) { [self.eventMenuBuilder addItemWithType:EventMenuItemTypeShare action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionShare] @@ -6769,7 +6771,7 @@ static CGSize kThreadListBarButtonItemImageSize; MXKRoomBubbleTableViewCell *roomBubbleTableViewCell = (MXKRoomBubbleTableViewCell *)cell; MXKAttachment *attachment = roomBubbleTableViewCell.bubbleData.attachment; - BOOL result = (event.eventType != MXEventTypePollStart && (!attachment || attachment.type != MXKAttachmentTypeSticker)); + BOOL result = !attachment || attachment.type != MXKAttachmentTypeSticker; if (attachment && !BuildSettings.messageDetailsAllowCopyMedia) { @@ -6795,6 +6797,8 @@ static CGSize kThreadListBarButtonItemImageSize; case MXEventTypeKeyVerificationMac: case MXEventTypeKeyVerificationDone: case MXEventTypeKeyVerificationCancel: + case MXEventTypePollStart: + case MXEventTypeBeaconInfo: result = NO; break; case MXEventTypeCustom: From 8a9f026715253d170c435b2a7bf4b264228373de Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Mon, 18 Jul 2022 15:48:58 +0200 Subject: [PATCH 3/4] LocationPlainCell: Support long press for context menu display. --- .../Plain/Cells/Location/LocationPlainCell.swift | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationPlainCell.swift b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationPlainCell.swift index 8ddcf39fe..1fe3eb738 100644 --- a/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationPlainCell.swift +++ b/Riot/Modules/Room/TimelineCells/Styles/Plain/Cells/Location/LocationPlainCell.swift @@ -130,6 +130,17 @@ class LocationPlainCell: SizableBaseRoomCell, RoomCellReactionsDisplayable, Room super.prepareForReuse() self.event = nil } + + override func onLongPressGesture(_ longPressGestureRecognizer: UILongPressGestureRecognizer!) { + + var userInfo: [String: Any]? + + if let event = self.event { + userInfo = [kMXKRoomBubbleCellEventKey: event] + } + + delegate.cell(self, didRecognizeAction: kMXKRoomBubbleCellLongPressOnEvent, userInfo: userInfo) + } } extension LocationPlainCell: RoomTimelineLocationViewDelegate { From 8c1e655a556f25fce5c36273946a8fa71f523ccc Mon Sep 17 00:00:00 2001 From: SBiOSoftWhare Date: Mon, 18 Jul 2022 16:53:37 +0200 Subject: [PATCH 4/4] Update changes --- changelog.d/6423.change | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/6423.change diff --git a/changelog.d/6423.change b/changelog.d/6423.change new file mode 100644 index 000000000..f09c38bc4 --- /dev/null +++ b/changelog.d/6423.change @@ -0,0 +1 @@ +Location sharing: Handle live location sharing start event reply in the timeline.