From af99c76d460f190e873ed88432c9a8b08324200b Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 19 Feb 2020 21:32:13 +0200 Subject: [PATCH] Add support for editing /me --- ui/room-view.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ui/room-view.go b/ui/room-view.go index 8b88b99..8132b8c 100644 --- a/ui/room-view.go +++ b/ui/room-view.go @@ -373,7 +373,11 @@ func (view *RoomView) SetEditing(evt *event.Event) { view.editMoveText = view.GetInputText() } view.editing = evt - view.input.SetText(view.editing.Content.Body) + text := view.editing.Content.Body + if view.editing.Content.MsgType == mautrix.MsgEmote { + text = "/me " + text + } + view.input.SetText(text) } view.status.SetText(view.GetStatus()) } @@ -458,7 +462,7 @@ func (view *RoomView) InputTabComplete(text string, cursorOffset int) { func (view *RoomView) InputSubmit(text string) { if len(text) == 0 { return - } else if cmd := view.parent.cmdProcessor.ParseCommand(view, text); view.editing == nil && cmd != nil { + } else if cmd := view.parent.cmdProcessor.ParseCommand(view, text); cmd != nil { go view.parent.cmdProcessor.HandleCommand(cmd) } else { go view.SendMessage(mautrix.MsgText, text)