1
0
Fork 0
forked from Mirrors/gomuks

Add Bump implementation to roster view

This commit is contained in:
FIGBERT 2023-03-30 09:45:52 -07:00
parent 22acad8287
commit 7a83ebd7f4
No known key found for this signature in database
GPG key ID: 67F1598D607A844B
2 changed files with 6 additions and 0 deletions

View file

@ -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) {

View file

@ -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()