diff --git a/cmd/guilds_tree.go b/cmd/guilds_tree.go index 871dfc23..2e0af9ca 100644 --- a/cmd/guilds_tree.go +++ b/cmd/guilds_tree.go @@ -207,16 +207,12 @@ func (gt *GuildsTree) onSelected(n *tview.TreeNode) { gt.selectedChannelID = ref app.SetFocus(mainFlex.messageInput) case nil: // Direct messages - cs, err := discordState.Cabinet.PrivateChannels() + cs, err := discordState.PrivateChannels() if err != nil { log.Println(err) return } - sort.Slice(cs, func(i, j int) bool { - return cs[i].LastMessageID > cs[j].LastMessageID - }) - for _, c := range cs { gt.createChannelNode(n, c) } diff --git a/cmd/messages_text.go b/cmd/messages_text.go index 3c339b95..a0a02049 100644 --- a/cmd/messages_text.go +++ b/cmd/messages_text.go @@ -75,15 +75,7 @@ func (mt *MessagesText) reset() { func (mt *MessagesText) createMessage(m discord.Message) { if cfg.HideBlockedUsers { - ready := discordState.Ready() - var isBlocked bool - for _, relationship := range ready.Relationships { - if relationship.Type == discord.BlockedRelationship && relationship.UserID == m.Author.ID { - isBlocked = true - break - } - } - + isBlocked := discordState.UserIsBlocked(m.Author.ID) if isBlocked { fmt.Fprintln(mt, "[:red:b]Blocked message[:-:-]") return