RoomVC: Add location sharing cell actions.

This commit is contained in:
SBiOSoftWhare 2022-05-03 15:58:56 +02:00
parent c67cff0e13
commit 9f330dba0a
4 changed files with 30 additions and 24 deletions

View file

@ -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

View file

@ -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)

View file

@ -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<MXKRoomBubbleCellDataStoring>)bubbleData;
didRequestLiveLocationPresentationForBubbleData:(id<MXKRoomBubbleCellDataStoring>)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;

View file

@ -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