diff options
author | Tulir Asokan <tulir@maunium.net> | 2020-02-19 21:32:13 +0200 |
---|---|---|
committer | Tulir Asokan <tulir@maunium.net> | 2020-02-19 21:32:13 +0200 |
commit | af99c76d460f190e873ed88432c9a8b08324200b (patch) | |
tree | 13fc0e583073a3290fa49cc1865edbb35353339f | |
parent | 0b0a40f7353107b4bdd5fe799b8fe20bf8eb90ff (diff) |
Add support for editing /me
-rw-r--r-- | ui/room-view.go | 8 |
1 files 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) |