Skip to content

Commit

Permalink
Make quoting work again
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Marbach <johannesm@element.io>
  • Loading branch information
Johennes committed Jun 21, 2022
1 parent a8514ed commit 3319e66
Show file tree
Hide file tree
Showing 2 changed files with 4 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 @@ -3687,9 +3687,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

0 comments on commit 3319e66

Please sign in to comment.