1
0
mirror of https://github.com/Rudi9719/kbtui.git synced 2026-03-22 08:47:24 +00:00

Breakout react

This commit is contained in:
Gregory Rudolph
2019-10-03 09:21:39 -04:00
parent 3662c6e09d
commit 2cd5db047e

16
main.go
View File

@ -333,16 +333,7 @@ func handleMessage(api keybase.ChatAPI) {
}
}
}
func reactToMessage(reaction string) {
chat := k.NewChat(channel)
chat.React(lastMessage.ID, reaction)
}
func reactToMessageId(messageId string, reaction string) {
chat := k.NewChat(channel)
ID, _ := strconv.Atoi(messageId)
chat.React(ID, reaction)
}
func handleInput() error {
clearView("Input")
inputString, _ := getInputString()
@ -361,11 +352,8 @@ func handleInput() error {
return nil
}
}
if inputString[:1] == "+" {
reactToMessage(strings.Replace(inputString, "+", "", 1))
} else {
go sendChat(inputString)
}
go sendChat(inputString)
go populateList()
return nil
}