aboutsummaryrefslogtreecommitdiff
path: root/ui/room-list.go
diff options
context:
space:
mode:
Diffstat (limited to 'ui/room-list.go')
-rw-r--r--ui/room-list.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/room-list.go b/ui/room-list.go
index 5f59136..1162ad5 100644
--- a/ui/room-list.go
+++ b/ui/room-list.go
@@ -83,6 +83,13 @@ func (list *RoomList) SetSelected(room *rooms.Room) {
list.selected = room
}
+func (list *RoomList) Get(n int) *rooms.Room {
+ if n < 0 || n >= len(list.items) {
+ return nil
+ }
+ return list.items[n]
+}
+
// Draw draws this primitive onto the screen.
func (list *RoomList) Draw(screen tcell.Screen) {
list.Box.Draw(screen)