Browse Source

React only to messages in current chat

pull/1/head
Gregory 'Rudi' Rudolph 5 years ago
parent
commit
911733495e
  1. 3
      main.go

3
main.go

@ -235,7 +235,9 @@ func handleMessage(api keybase.ChatAPI, g *gocui.Gui) {
if api.Msg.Channel.MembersType == channel.MembersType && cleanChannelName(api.Msg.Channel.Name) == channel.Name { 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))
chat := k.NewChat(channel) chat := k.NewChat(channel)
lastMessage.ID = api.Msg.ID
chat.Read(api.Msg.ID) chat.Read(api.Msg.ID)
} }
} else { } else {
if api.Msg.Channel.MembersType == keybase.TEAM { if api.Msg.Channel.MembersType == keybase.TEAM {
@ -245,7 +247,6 @@ func handleMessage(api keybase.ChatAPI, g *gocui.Gui) {
printToView(g, "Chat", fmt.Sprintf("PM @%s [%s]: %s", cleanChannelName(channelName), msgSender, msgBody)) printToView(g, "Chat", fmt.Sprintf("PM @%s [%s]: %s", cleanChannelName(channelName), msgSender, msgBody))
} }
} }
lastMessage = api
} else { } else {
//TODO: For edit/delete run this //TODO: For edit/delete run this
if api.Msg.Channel.MembersType == channel.MembersType && cleanChannelName(api.Msg.Channel.Name) == channel.Name { if api.Msg.Channel.MembersType == channel.MembersType && cleanChannelName(api.Msg.Channel.Name) == channel.Name {

Loading…
Cancel
Save