Add Client.get_room_by_id()

This commit is contained in:
2016-03-16 17:38:50 +01:00
committed by Gergely Polonkai
parent 9f236de0b9
commit c8f815c542
2 changed files with 26 additions and 0 deletions

View File

@@ -439,4 +439,18 @@ public class Matrix.HTTPClient : Matrix.HTTPAPI, Matrix.Client {
throw new Matrix.Error.UNSUPPORTED(
"Per-room presences are not supported yet.");
}
public Room
get_room_by_id(string room_id)
throws Matrix.Error
{
Room? room;
if ((room = _rooms[room_id]) == null) {
throw new Matrix.Error.UNAVAILABLE(
"Room data for %s is not cached yet.", room_id);
}
return room;
}
}