Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable reporting of live location shares (PSF-1066) #6326

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1618,6 +1618,11 @@ - (NSAttributedString *)attributedStringFromEvent:(MXEvent*)event
displayText = [MXEventContentPollStart modelFromJSON:event.content].question;
break;
}
case MXEventTypeBeaconInfo:
{
displayText = [MXBeaconInfo modelFromJSON:event.content].desc;
break;
}
default:
*error = MXKEventFormatterErrorUnknownEventType;
break;
Expand Down
21 changes: 4 additions & 17 deletions Riot/Modules/Room/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3662,22 +3662,6 @@ - (void)showAdditionalActionsMenuForEvent:(MXEvent*)selectedEvent inCell:(id<MXK
}]];
}

if (selectedEvent.sentState == MXEventSentStateSent &&
selectedEvent.eventType != MXEventTypePollStart &&
!selectedEvent.location)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeForward
action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
style:UIAlertActionStyleDefault
handler:^(UIAlertAction * action) {
MXStrongifyAndReturnIfNil(self);

[self cancelEventSelection];

[self presentEventForwardingDialogForSelectedEvent:selectedEvent];
}]];
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the block above because there is another if below without !selectedEvent.location which effectively made this a no-op.

if (!isJitsiCallEvent && selectedEvent.eventType != MXEventTypePollStart)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeQuote
Expand All @@ -3696,7 +3680,10 @@ - (void)showAdditionalActionsMenuForEvent:(MXEvent*)selectedEvent inCell:(id<MXK
}]];
}

if (selectedEvent.sentState == MXEventSentStateSent && selectedEvent.eventType != MXEventTypePollStart)
if (selectedEvent.sentState == MXEventSentStateSent &&
selectedEvent.eventType != MXEventTypePollStart &&
// Forwarding of live-location shares still to be implemented
selectedEvent.eventType != MXEventTypeBeaconInfo)
{
[self.eventMenuBuilder addItemWithType:EventMenuItemTypeForward
action:[UIAlertAction actionWithTitle:[VectorL10n roomEventActionForward]
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-6326.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Enable reporting of live location shares