deleting a channel now clears the readstate
MODIFY
readstate/readmarkers.go
readstate/readmarkers.go
@@ -31,6 +31,14 @@ func Load(readState []*discordgo.ReadState) {
}
}
+// ClearReadStateFor clears all entries for the given Channel.
+func ClearReadStateFor(channelID string) {
+ timerMutex.Lock()
+ delete(data, channelID)
+ delete(ackTimers, channelID)
+ timerMutex.Unlock()
+}
+
// UpdateRead tells the discord server that a channel has been read. If the
// channel has already been read and this method was called needlessly, then
// this will be a No-OP.

MODIFY
ui/window.go
ui/window.go
@@ -1387,6 +1387,7 @@ func (window *Window) registerPrivateChatsHandler() {
window.app.QueueUpdateDraw(func() {
window.privateList.RemoveChannel(event.Channel)
})
+ readstate.ClearReadStateFor(event.ID)
}
})

deleting a channel now clears the readstate