Add /edit command. Fixes #200
This commit is contained in:
parent
2aeaff5b97
commit
d9407ee8ee
@ -101,6 +101,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
|
||||
"remove": {"redact"},
|
||||
"rm": {"redact"},
|
||||
"del": {"redact"},
|
||||
"e": {"edit"},
|
||||
"dl": {"download"},
|
||||
"o": {"open"},
|
||||
},
|
||||
@ -135,6 +136,7 @@ func NewCommandProcessor(parent *MainView) *CommandProcessor {
|
||||
"reply": cmdReply,
|
||||
"redact": cmdRedact,
|
||||
"react": cmdReact,
|
||||
"edit": cmdEdit,
|
||||
"download": cmdDownload,
|
||||
"open": cmdOpen,
|
||||
"copy": cmdCopy,
|
||||
|
@ -158,6 +158,7 @@ const (
|
||||
SelectReply SelectReason = "reply to"
|
||||
SelectReact = "react to"
|
||||
SelectRedact = "redact"
|
||||
SelectEdit = "edit"
|
||||
SelectDownload = "download"
|
||||
SelectOpen = "open"
|
||||
SelectCopy = "copy"
|
||||
@ -167,6 +168,10 @@ func cmdReply(cmd *Command) {
|
||||
cmd.Room.StartSelecting(SelectReply, strings.Join(cmd.Args, " "))
|
||||
}
|
||||
|
||||
func cmdEdit(cmd *Command) {
|
||||
cmd.Room.StartSelecting(SelectEdit, "")
|
||||
}
|
||||
|
||||
func cmdRedact(cmd *Command) {
|
||||
cmd.Room.StartSelecting(SelectRedact, strings.Join(cmd.Args, " "))
|
||||
}
|
||||
@ -450,6 +455,7 @@ Things: rooms, users, baremessages, images, typingnotif, unverified
|
||||
/reply [text] - Reply to the selected message.
|
||||
/react <reaction> - React to the selected message.
|
||||
/redact [reason] - Redact the selected message.
|
||||
/edit - Edit the selected message.
|
||||
|
||||
# Encryption
|
||||
/fingerprint - View the fingerprint of your device.
|
||||
|
@ -197,6 +197,8 @@ func (view *RoomView) OnSelect(message *messages.UIMessage) {
|
||||
if len(view.selectContent) > 0 {
|
||||
go view.SendMessage(event.MsgText, view.selectContent)
|
||||
}
|
||||
case SelectEdit:
|
||||
view.SetEditing(message.Event)
|
||||
case SelectReact:
|
||||
go view.SendReaction(message.EventID, view.selectContent)
|
||||
case SelectRedact:
|
||||
|
Loading…
Reference in New Issue
Block a user