From 62b08349d28aa91cbfac7bf7c122a6e39a96d729 Mon Sep 17 00:00:00 2001 From: Gregory 'Rudi' Rudolph Date: Sun, 22 Sep 2019 07:11:12 -0400 Subject: [PATCH] Mark unread messages --- README.md | 2 +- main.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 010ad38..2c393fc 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,10 @@ It started as a joke, then a bash script, and now here it is! * Stream view to see all incoming messages * List view to show activity * Chat view to interact with the current channel +* Marks unread messages in the List view ## Todo * Reactions to messages -* Mark unread messages in the List view * Pretty format headers in List view * Twitter-style feed reading public messages * Track multiple conversations at once diff --git a/main.go b/main.go index 29d3178..12648a2 100644 --- a/main.go +++ b/main.go @@ -82,11 +82,17 @@ func populateList(g *gocui.Gui) { if s.Channel.MembersType == keybase.TEAM { recentChannelsCount++ if recentChannelsCount <= ((maxY - 2) / 3) { + if s.Unread { + recentChannels += "*" + } recentChannels += fmt.Sprintf("%s\n\t#%s\n", s.Channel.Name, s.Channel.TopicName) } } else { recentPMsCount++ if recentPMsCount <= ((maxY- 2) / 3) { + if s.Unread { + recentPMs += "*" + } recentPMs += fmt.Sprintf("%s\n", cleanChannelName(s.Channel.Name)) } }