From 2b018ebc765f1d90f2401d040e890f752a8f98e0 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Thu, 10 Oct 2019 11:17:37 -0400 Subject: [PATCH] Update chat if reactions occur: Prep for showing reactions in PS1 --- tcmdShowReactions.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tcmdShowReactions.go b/tcmdShowReactions.go index 763e33c..56b1471 100644 --- a/tcmdShowReactions.go +++ b/tcmdShowReactions.go @@ -21,10 +21,26 @@ func init() { func tcmdShowReactions(m keybase.ChatAPI) { where := "" + team := false if m.Msg.Channel.MembersType == keybase.TEAM { + team = true where = fmt.Sprintf("in @%s#%s", m.Msg.Channel.Name, m.Msg.Channel.TopicName) } else { where = fmt.Sprintf("in a PM") } printToView("Feed", fmt.Sprintf("%s reacted to %d with %s %s", m.Msg.Sender.Username, m.Msg.Content.Reaction.M, m.Msg.Content.Reaction.B, where)) + if channel.Name == m.Msg.Channel.Name { + if team { + if channel.TopicName == m.Msg.Channel.TopicName { + clearView("Chat") + go populateChat() + } + + } else { + clearView("Chat") + go populateChat() + } + + } + }