diff --git a/Riot/Modules/Room/MXKRoomViewController.m b/Riot/Modules/Room/MXKRoomViewController.m index ba1dd3e21..a8d79f084 100644 --- a/Riot/Modules/Room/MXKRoomViewController.m +++ b/Riot/Modules/Room/MXKRoomViewController.m @@ -3045,22 +3045,6 @@ [self promptUserToResendEvent:selectedEvent.eventId]; } } - else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellStopShareButtonPressed]) - { - MXEvent *selectedEvent = userInfo[kMXKRoomBubbleCellEventKey]; - if (selectedEvent) - { - // TODO: - Implement stop live location action - } - } - else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellRetryShareButtonPressed]) - { - MXEvent *selectedEvent = userInfo[kMXKRoomBubbleCellEventKey]; - if (selectedEvent) - { - // TODO: - Implement retry live location action - } - } } #pragma mark - Clipboard diff --git a/Riot/Modules/Room/RoomViewController+LocationSharing.swift b/Riot/Modules/Room/RoomViewController+LocationSharing.swift index d0a69b2c4..ffc9bf57d 100644 --- a/Riot/Modules/Room/RoomViewController+LocationSharing.swift +++ b/Riot/Modules/Room/RoomViewController+LocationSharing.swift @@ -53,7 +53,7 @@ import Foundation guard let self = self else { return } - self.delegate?.roomViewControllerDidStopLiveLocationSharing(self) + self.delegate?.roomViewControllerDidStopLiveLocationSharing(self, beaconInfoEventId: nil) } self.topBannersStackView?.addArrangedSubview(bannerView) diff --git a/Riot/Modules/Room/RoomViewController.h b/Riot/Modules/Room/RoomViewController.h index 1d2dc1c3c..6e6107899 100644 --- a/Riot/Modules/Room/RoomViewController.h +++ b/Riot/Modules/Room/RoomViewController.h @@ -70,6 +70,9 @@ extern NSNotificationName const RoomGroupCallTileTappedNotification; // Remove Jitsi widget container @property (weak, nonatomic, nullable) IBOutlet UIView *removeJitsiWidgetContainer; +// Error presenter +@property (nonatomic, strong, readonly) MXKErrorAlertPresentation *errorPresenter; + /** Preview data for a room invitation received by email, or a link to a room. */ @@ -251,8 +254,7 @@ didRequestLocationPresentationForEvent:(MXEvent *)event /// Ask the coordinator to present the live location sharing viewer. - (void)roomViewController:(RoomViewController *)roomViewController -didRequestLiveLocationPresentationForEvent:(MXEvent *)event - bubbleData:(id)bubbleData; +didRequestLiveLocationPresentationForBubbleData:(id)bubbleData; - (nullable UIActivityViewController *)roomViewController:(RoomViewController *)roomViewController locationShareActivityViewControllerForEvent:(MXEvent *)event; @@ -286,7 +288,7 @@ didRequestEditForPollWithStartEvent:(MXEvent *)startEvent; - (void)roomViewControllerDidStopLoading:(RoomViewController *)roomViewController; /// User tap live location sharing stop action -- (void)roomViewControllerDidStopLiveLocationSharing:(RoomViewController *)roomViewController; +- (void)roomViewControllerDidStopLiveLocationSharing:(RoomViewController *)roomViewController beaconInfoEventId:(nullable NSString*)beaconInfoEventId; /// User tap live location sharing banner - (void)roomViewControllerDidTapLiveLocationSharingBanner:(RoomViewController *)roomViewController; diff --git a/Riot/Modules/Room/RoomViewController.m b/Riot/Modules/Room/RoomViewController.m index 9017d4d2c..4a6caca8c 100644 --- a/Riot/Modules/Room/RoomViewController.m +++ b/Riot/Modules/Room/RoomViewController.m @@ -3156,6 +3156,26 @@ static CGSize kThreadListBarButtonItemImageSize; [self mention:roomMember]; } } + else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellStopShareButtonPressed]) + { + NSString *beaconInfoEventId; + + if ([bubbleData isKindOfClass:[RoomBubbleCellData class]]) + { + RoomBubbleCellData *roomBubbleCellData = (RoomBubbleCellData*)bubbleData; + beaconInfoEventId = roomBubbleCellData.beaconInfoSummary.id; + } + + [self.delegate roomViewControllerDidStopLiveLocationSharing:self beaconInfoEventId:beaconInfoEventId]; + } + else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellRetryShareButtonPressed]) + { + MXEvent *selectedEvent = userInfo[kMXKRoomBubbleCellEventKey]; + if (selectedEvent) + { + // TODO: - Implement retry live location action + } + } else if ([actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnMessageTextView] || [actionIdentifier isEqualToString:kMXKRoomBubbleCellTapOnContentView]) { // Retrieve the tapped event @@ -3166,6 +3186,10 @@ static CGSize kThreadListBarButtonItemImageSize; { [self cancelEventSelection]; } + else if (bubbleData.tag == RoomBubbleCellDataTagLiveLocation) + { + [self.delegate roomViewController:self didRequestLiveLocationPresentationForBubbleData:bubbleData]; + } else if (tappedEvent) { if (tappedEvent.eventType == MXEventTypeRoomCreate) @@ -3215,10 +3239,6 @@ static CGSize kThreadListBarButtonItemImageSize; [self selectEventWithId:tappedEvent.eventId]; } } - else if (bubbleData.tag == RoomBubbleCellDataTagLiveLocation) - { - [self.delegate roomViewController:self didRequestLiveLocationPresentationForEvent:tappedEvent bubbleData:bubbleData]; - } else { // Show contextual menu on single tap if bubble is not collapsed