Skip to content

Commit

Permalink
Merge pull request #6447 from vector-im/steve/6423_lls_reply
Browse files Browse the repository at this point in the history
Location sharing: Handle live location sharing start event reply in the timeline (PSG-4)
  • Loading branch information
SBiOSoftWhare authored Jul 18, 2022
2 parents c467308 + 8c1e655 commit 1d6a61c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand Down
10 changes: 7 additions & 3 deletions Riot/Modules/Room/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3683,7 +3683,8 @@ - (void)showAdditionalActionsMenuForEvent:(MXEvent*)selectedEvent inCell:(id<MXK
}]];
}

if (!isJitsiCallEvent && selectedEvent.eventType != MXEventTypePollStart)
if (!isJitsiCallEvent && selectedEvent.eventType != MXEventTypePollStart &&
selectedEvent.eventType != MXEventTypeBeaconInfo)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeQuote
action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionQuote]
Expand Down Expand Up @@ -3719,7 +3720,8 @@ - (void)showAdditionalActionsMenuForEvent:(MXEvent*)selectedEvent inCell:(id<MXK
}]];
}

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]
Expand Down Expand Up @@ -6769,7 +6771,7 @@ - (BOOL)canCopyEvent:(MXEvent*)event andCell:(id<MXKCellRendering>)cell
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)
{
Expand All @@ -6795,6 +6797,8 @@ - (BOOL)canCopyEvent:(MXEvent*)event andCell:(id<MXKCellRendering>)cell
case MXEventTypeKeyVerificationMac:
case MXEventTypeKeyVerificationDone:
case MXEventTypeKeyVerificationCancel:
case MXEventTypePollStart:
case MXEventTypeBeaconInfo:
result = NO;
break;
case MXEventTypeCustom:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions changelog.d/6423.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Location sharing: Handle live location sharing start event reply in the timeline.

0 comments on commit 1d6a61c

Please sign in to comment.