Hide tombstoned rooms from room list
This commit is contained in:
		@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
@@ -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)
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user