1
0
Fork 0
forked from Mirrors/gomuks

Move utility functions above mauview interfaces

This commit is contained in:
FIGBERT 2023-03-18 11:59:07 -07:00
parent 0af8d507e1
commit 9cecf0bd02
No known key found for this signature in database
GPG key ID: 67F1598D607A844B

View file

@ -108,6 +108,14 @@ func (rstr *RosterView) getMostRecentMessage(room *rooms.Room) (string, bool) {
return "It's quite empty in here.", false
}
func (rstr *RosterView) First() *rooms.Room {
return rstr.rooms[0]
}
func (rstr *RosterView) Last() *rooms.Room {
return rstr.rooms[len(rstr.rooms)-1]
}
func (rstr *RosterView) Draw(screen mauview.Screen) {
if rstr.focused {
if roomView, ok := rstr.parent.getRoomView(rstr.selected.ID, true); ok {
@ -228,11 +236,3 @@ func (rstr *RosterView) OnKeyEvent(event mauview.KeyEvent) bool {
}
return true
}
func (rstr *RosterView) First() *rooms.Room {
return rstr.rooms[0]
}
func (rstr *RosterView) Last() *rooms.Room {
return rstr.rooms[len(rstr.rooms)-1]
}