From 7a83ebd7f4c2f2a094046cab758417363ba1f9ca Mon Sep 17 00:00:00 2001 From: FIGBERT Date: Thu, 30 Mar 2023 09:45:52 -0700 Subject: [PATCH] Add Bump implementation to roster view --- ui/view-main.go | 1 + ui/view-roster.go | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ui/view-main.go b/ui/view-main.go index 2ade735..94c6808 100644 --- a/ui/view-main.go +++ b/ui/view-main.go @@ -409,6 +409,7 @@ func sendNotification(room *rooms.Room, sender, text string, critical, sound boo func (view *MainView) Bump(room *rooms.Room) { view.roomList.Bump(room) + view.rosterView.Bump(room) } func (view *MainView) NotifyMessage(room *rooms.Room, message ifc.Message, should pushrules.PushActionArrayShould) { diff --git a/ui/view-roster.go b/ui/view-roster.go index 8212e77..a26e9a7 100644 --- a/ui/view-roster.go +++ b/ui/view-roster.go @@ -91,6 +91,11 @@ func (rstr *RosterView) Remove(room *rooms.Room) { rstr.rooms = rstr.rooms[:last] } +func (rstr *RosterView) Bump(room *rooms.Room) { + rstr.Remove(room) + rstr.Add(room) +} + func (rstr *RosterView) index(room *rooms.Room) int { rstr.Lock() defer rstr.Unlock()