Browse Source

Create new jsonData var with every new message instead of reusing the same var. This fixes the bug where IsEphemeral is true for every message after one ephemeral message is received, and probably countless other unknown bugs.

main
Sam 5 years ago
parent
commit
b00e56e8dd
  1. 2
      chat.go

2
chat.go

@ -71,8 +71,8 @@ func getNewMessages(k *Keybase, c chan<- ChatAPI, execOptions []string) { @@ -71,8 +71,8 @@ func getNewMessages(k *Keybase, c chan<- ChatAPI, execOptions []string) {
execCmd.Start()
scanner := bufio.NewScanner(stdOut)
go func(scanner *bufio.Scanner, c chan<- ChatAPI) {
var jsonData ChatAPI
for scanner.Scan() {
var jsonData ChatAPI
json.Unmarshal([]byte(scanner.Text()), &jsonData)
c <- jsonData
}

Loading…
Cancel
Save