aboutsummaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/fuzzy-search-modal.go5
-rw-r--r--ui/room-list.go6
2 files changed, 10 insertions, 1 deletions
diff --git a/ui/fuzzy-search-modal.go b/ui/fuzzy-search-modal.go
index 97a029a..9f91877 100644
--- a/ui/fuzzy-search-modal.go
+++ b/ui/fuzzy-search-modal.go
@@ -89,6 +89,10 @@ func (fs *FuzzySearchModal) Blur() {
func (fs *FuzzySearchModal) InitList(rooms map[string]*RoomView) {
for _, room := range rooms {
+ if room.Room.IsReplaced() {
+ //if _, ok := rooms[room.Room.ReplacedBy()]; ok
+ continue
+ }
fs.roomList = append(fs.roomList, room.Room)
fs.roomTitles = append(fs.roomTitles, room.Room.GetTitle())
}
@@ -134,6 +138,7 @@ func (fs *FuzzySearchModal) OnKeyEvent(event mauview.KeyEvent) bool {
fs.results.Highlight(strconv.Itoa(fs.matches[fs.selected].OriginalIndex))
fs.results.ScrollToHighlight()
}
+ return true
case tcell.KeyEnter:
// Switch room to currently selected room
if len(highlights) > 0 {
diff --git a/ui/room-list.go b/ui/room-list.go
index b6fc612..2b8af87 100644
--- a/ui/room-list.go
+++ b/ui/room-list.go
@@ -88,7 +88,11 @@ func (list *RoomList) Contains(roomID string) bool {
}
func (list *RoomList) Add(room *rooms.Room) {
- debug.Print("Adding room to list", room.ID, room.GetTitle(), room.IsDirect, room.Tags())
+ if room.IsReplaced() {
+ debug.Print(room.ID, "is replaced by", room.ReplacedBy(), "-> not adding to room list")
+ return
+ }
+ debug.Print("Adding room to list", room.ID, room.GetTitle(), room.IsDirect, room.ReplacedBy(), room.Tags())
for _, tag := range room.Tags() {
list.AddToTag(tag, room)
}