From acba597e8bfefb49d066dfdca129cecbaf356b88 Mon Sep 17 00:00:00 2001 From: Eric Eastwood Date: Mon, 27 Mar 2023 15:31:46 -0500 Subject: [PATCH] Label magic number --- src/matrix/room/PowerLevels.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/matrix/room/PowerLevels.js b/src/matrix/room/PowerLevels.js index 63a5b0b0..aefbfaf1 100644 --- a/src/matrix/room/PowerLevels.js +++ b/src/matrix/room/PowerLevels.js @@ -16,6 +16,9 @@ limitations under the License. export const EVENT_TYPE = "m.room.power_levels"; +// See https://spec.matrix.org/latest/client-server-api/#mroompower_levels +const STATE_DEFAULT_POWER_LEVEL = 50; + export class PowerLevels { constructor({powerLevelEvent, createEvent, ownUserId, membership}) { this._plEvent = powerLevelEvent; @@ -70,8 +73,7 @@ export class PowerLevels { if (typeof level === "number") { return level; } else { - // TODO: Why does this default to 50? - return 50; + return STATE_DEFAULT_POWER_LEVEL; } }