Browse Source

Messages loading in proper order

pull/1/head
Gregory Rudolph 5 years ago
parent
commit
7c87d911ee
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 4
      main.go

4
main.go

@ -41,6 +41,7 @@ func populateChat(g *gocui.Gui) {
log.Fatal(err) log.Fatal(err)
} else { } else {
var printMe []string var printMe []string
var actuallyPrintMe string
for _, message := range api.Result.Messages { for _, message := range api.Result.Messages {
if message.Msg.Content.Type == "text" { if message.Msg.Content.Type == "text" {
msgSender := message.Msg.Sender.Username msgSender := message.Msg.Sender.Username
@ -50,8 +51,9 @@ func populateChat(g *gocui.Gui) {
} }
} }
for i := len(printMe) - 1; i >= 0; i-- { for i := len(printMe) - 1; i >= 0; i-- {
printToView(g, "Chat", printMe[i]) actuallyPrintMe += printMe[i] + "\n"
} }
printToView(g, "Chat", actuallyPrintMe)
} }
} }

Loading…
Cancel
Save