Method: MatrixSdk::Client#rooms

Defined in:
lib/matrix_sdk/client.rb

#roomsArray[Room]

Note:

This will always return the empty array if the cache level is set to :none

Gets a list of all relevant rooms, either the ones currently handled by the client, or the list of currently joined ones if no rooms are handled

Returns:

  • (Array[Room])

    All the currently handled rooms



165
166
167
168
169
170
171
172
173
# File 'lib/matrix_sdk/client.rb', line 165

def rooms
  if @rooms.empty? && cache != :none
    api.get_joined_rooms.joined_rooms.each do |id|
      ensure_room(id)
    end
  end

  @rooms.values
end