From 3dd3568384b30f8fbd81bf3d31943feb140f9f3d Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Fri, 18 Mar 2016 11:59:57 +0100 Subject: [PATCH] Add per-room profile caching --- src/matrix-http-client.vala | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/matrix-http-client.vala b/src/matrix-http-client.vala index 4bdda7a..6f2081c 100644 --- a/src/matrix-http-client.vala +++ b/src/matrix-http-client.vala @@ -414,8 +414,14 @@ public class Matrix.HTTPClient : Matrix.HTTPAPI, Matrix.Client { return profile; } - throw new Matrix.Error.UNSUPPORTED( - "Per-room profiles are not supported yet."); + var room = _rooms[room_id]; + + if (room == null) { + throw new Matrix.Error.UNAVAILABLE( + "Room data for %s is not cached yet.", room_id); + } + + return room.get_member(user_id, null); } public Presence