Muted channels won't get live-unread markers anymore
MODIFY
readstate/readmarkers.go
readstate/readmarkers.go
@@ -139,12 +139,9 @@ func HasGuildBeenRead(guildID string) bool {
return true
}
-// HasBeenRead checks whether the passed channel has an unread Message or not.
-func HasBeenRead(channel *discordgo.Channel, lastMessageID string) bool {
- if lastMessageID == "" {
- return true
- }
-
+// IsChannelMuted checks whether the channel is muted or not. Currently this
+// only works for guild channels.
+func IsChannelMuted(channel *discordgo.Channel) bool {
if channel.GuildID != "" {
for _, settings := range state.UserGuildSettings {
if settings.GuildID == channel.GuildID {
@@ -161,6 +158,21 @@ func HasBeenRead(channel *discordgo.Channel, lastMessageID string) bool {
}
}
+ //FIXME Do this for private channels
+
+ return false
+}
+
+// HasBeenRead checks whether the passed channel has an unread Message or not.
+func HasBeenRead(channel *discordgo.Channel, lastMessageID string) bool {
+ if lastMessageID == "" {
+ return true
+ }
+
+ if IsChannelMuted(channel) {
+ return true
+ }
+
data, present := data[channel.ID]
if !present {
return false

MODIFY
ui/window.go
ui/window.go
@@ -1297,8 +1297,10 @@ func (window *Window) startMessageHandlerRoutines(input, edit, delete chan *disc
if mentionsYou {
window.channelTree.MarkChannelAsMentioned(channel.ID)
} else {
+ if !readstate.IsChannelMuted(channel) {
window.channelTree.MarkChannelAsUnread(channel.ID)
}
+ }
})
}
}

Muted channels won't get live-unread markers anymore