at long last fix bug where /op would cache previous failed attempts. fixes SYWEB-342

This commit is contained in:
Matthew Hodgson
2015-07-17 18:01:58 +01:00
parent c563380a0b
commit 9d5fc7c0fd
+3 -1
View File
@@ -211,7 +211,9 @@ MatrixClient.prototype.setPowerLevel = function(roomId, userId, powerLevel,
users: {}
};
if (event && event.getType() === "m.room.power_levels") {
content = event.getContent();
// take a copy of the content to ensure we don't corrupt
// existing client state with a failed power level change
content = utils.deepCopy(event.getContent());
}
content.users[userId] = powerLevel;
var path = utils.encodeUri("/rooms/$roomId/state/m.room.power_levels", {