Browse Source

Fix bug going from channel to PM

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

5
main.go

@ -48,7 +48,7 @@ func populateChat(g *gocui.Gui) { @@ -48,7 +48,7 @@ func populateChat(g *gocui.Gui) {
if message.Msg.Content.Type == "text" {
msgSender := message.Msg.Sender.Username
msgBody := message.Msg.Content.Text.Body
newMessage := fmt.Sprintf("%s: %s", msgSender, msgBody)
newMessage := fmt.Sprintf("[%s]: %s", msgSender, msgBody)
printMe = append(printMe, newMessage)
}
}
@ -200,7 +200,7 @@ func handleMessage(api keybase.ChatAPI, g *gocui.Gui) { @@ -200,7 +200,7 @@ func handleMessage(api keybase.ChatAPI, g *gocui.Gui) {
}
}
if api.Msg.Channel.MembersType == channel.MembersType && cleanChannelName(api.Msg.Channel.Name) == channel.Name {
printToView(g, "Chat", fmt.Sprintf("%s: %s", msgSender, msgBody))
printToView(g, "Chat", fmt.Sprintf("[%s]: %s", msgSender, msgBody))
}
}
}
@ -223,6 +223,7 @@ func handleInput(g *gocui.Gui) error { @@ -223,6 +223,7 @@ func handleInput(g *gocui.Gui) error {
} else if len(command) == 2 {
channel.MembersType = keybase.USER
channel.Name = command[1]
channel.TopicName = ""
printToView(g, "Feed", fmt.Sprintf("You have joined: @%s", channel.Name))
clearView(g, "Chat")
go populateChat(g)

Loading…
Cancel
Save