mirror of https://github.com/vector-im/riot-web
Fix setBotPower to not use `.content` (#7179)
* Fix setBotPower to not use `.content` * Simplify currentPlpull/21833/head
parent
fb11779785
commit
11aa362eda
|
@ -473,10 +473,7 @@ async function setBotPower(
|
||||||
// If the PL is equal to or greater than the requested PL, ignore.
|
// If the PL is equal to or greater than the requested PL, ignore.
|
||||||
if (ignoreIfGreater === true) {
|
if (ignoreIfGreater === true) {
|
||||||
// As per https://matrix.org/docs/spec/client_server/r0.6.0#m-room-power-levels
|
// As per https://matrix.org/docs/spec/client_server/r0.6.0#m-room-power-levels
|
||||||
const currentPl = (
|
const currentPl = powerLevels.users?.[userId] ?? powerLevels.users_default ?? 0;
|
||||||
powerLevels.content.users && powerLevels.content.users[userId]
|
|
||||||
) || powerLevels.content.users_default || 0;
|
|
||||||
|
|
||||||
if (currentPl >= level) {
|
if (currentPl >= level) {
|
||||||
return sendResponse(event, {
|
return sendResponse(event, {
|
||||||
success: true,
|
success: true,
|
||||||
|
|
Loading…
Reference in New Issue