Browse Source

Mark messages as read, if they're read.

pull/1/head
Gregory 'Rudi' Rudolph 5 years ago
parent
commit
7b5bc31e58
  1. 8
      main.go

8
main.go

@ -13,9 +13,7 @@ import (
var k = keybase.NewKeybase() var k = keybase.NewKeybase()
var channel keybase.Channel var channel keybase.Channel
var channels [] keybase.Channel var channels [] keybase.Channel
//var lastListTs = time.Now()
var stream bool = false var stream bool = false
//var updates = 0
func main() { func main() {
if !k.LoggedIn { if !k.LoggedIn {
fmt.Println("You are not logged in.") fmt.Println("You are not logged in.")
@ -71,10 +69,6 @@ func sendChat(message string) {
} }
func populateList(g *gocui.Gui) { func populateList(g *gocui.Gui) {
//if time.Since(lastListTs) < (10 * time.Second) && updates != 1{
// return
//}
//lastListTs = time.Now()
_, maxY := g.Size() _, maxY := g.Size()
if testVar, err := k.ChatList(); err != nil { if testVar, err := k.ChatList(); err != nil {
log.Printf("%+v",err) log.Printf("%+v",err)
@ -227,6 +221,8 @@ 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.Read(api.Msg.ID)
} }
} else { } else {
if api.Msg.Channel.MembersType == keybase.TEAM { if api.Msg.Channel.MembersType == keybase.TEAM {

Loading…
Cancel
Save