Update power levels in Matrix.Room objects when a m.room.power_levels event arrives

This commit is contained in:
Gergely Polonkai 2016-03-18 16:58:49 +01:00 committed by Gergely Polonkai
parent 3f7057c652
commit 4db2d5ebf2
1 changed files with 10 additions and 0 deletions

View File

@ -204,6 +204,16 @@ public class Matrix.HTTPClient : Matrix.HTTPAPI, Matrix.Client {
room.kick_level = levt.kick;
room.redact_level = levt.redact;
room.invite_level = levt.invite;
room.clear_user_levels();
room.clear_event_levels();
foreach (var entry in levt.user_levels.entries) {
room.set_user_level(entry.key, entry.value);
}
foreach (var entry in levt.event_levels.entries) {
room.set_event_level(entry.key, entry.value);
}
} else if (evt is Matrix.Event.RoomTopic) {
var tevt = (Matrix.Event.RoomTopic)evt;