Skip to content

Commit

Permalink
Merge pull request #6328 from vector-im/johannes/quoting
Browse files Browse the repository at this point in the history
Make quoting context menu action work again
  • Loading branch information
Johennes authored Jun 21, 2022
2 parents 7c81f67 + fbdd11f commit 03d37b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Riot/Modules/Room/RoomViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -3708,9 +3708,10 @@ - (void)showAdditionalActionsMenuForEvent:(MXEvent*)selectedEvent inCell:(id<MXK
MXStrongifyAndReturnIfNil(self);

[self cancelEventSelection];

// Quote the message a la Markdown into the input toolbar composer
self.inputToolbarView.textMessage = [NSString stringWithFormat:@"%@\n>%@\n\n", self.inputToolbarView.textMessage, selectedComponent.textMessage];
NSString *prefix = [self.inputToolbarView.textMessage length] ? [NSString stringWithFormat:@"%@\n", self.inputToolbarView.textMessage] : @"";
self.inputToolbarView.textMessage = [NSString stringWithFormat:@"%@>%@\n\n", prefix, selectedComponent.textMessage];

// And display the keyboard
[self.inputToolbarView becomeFirstResponder];
Expand Down
5 changes: 1 addition & 4 deletions Riot/Modules/Room/Views/InputToolbar/RoomInputToolbarView.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,7 @@ -(void)customizeViewRendering

- (void)setTextMessage:(NSString *)textMessage
{
if (!textMessage)
{
[self setAttributedTextMessage:nil];
}
[self setAttributedTextMessage:textMessage ? [[NSAttributedString alloc] initWithString:textMessage] : nil];
}

- (void)setAttributedTextMessage:(NSAttributedString *)attributedTextMessage
Expand Down
1 change: 1 addition & 0 deletions changelog.d/pr-6328.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Make quoting context menu action work again

0 comments on commit 03d37b5

Please sign in to comment.