Browse Source

Bugfix: Up arrow in stream/start crashes application

pull/25/head
Gregory Rudolph 5 years ago
parent
commit
db6e367fac
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 10
      cmdEdit.go

10
cmdEdit.go

@ -25,10 +25,16 @@ func cmdEdit(cmd []string) { @@ -25,10 +25,16 @@ func cmdEdit(cmd []string) {
if len(cmd) == 2 || len(cmd) == 1 {
if len(cmd) == 2 {
messageId, _ = strconv.Atoi(cmd[1])
} else {
} else if lastMessage.ID != 0 {
if lastMessage.Type != "text" {
printToView("Feed", "Last message isn't editable (is it an edit?)")
return
}
messageId = lastMessage.ID
} else {
printToView("Feed", "No message to edit")
return
}
origMessage, _ := chat.ReadMessage(messageId)
if origMessage.Result.Messages[0].Msg.Content.Type != "text" {
printToView("Feed", fmt.Sprintf("%+v", origMessage))

Loading…
Cancel
Save