You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-05 23:10:41 +03:00
Fix setBotPower to not use .content (#7179)
* Fix setBotPower to not use `.content` * Simplify currentPl
This commit is contained in:
@@ -473,10 +473,7 @@ async function setBotPower(
|
||||
// If the PL is equal to or greater than the requested PL, ignore.
|
||||
if (ignoreIfGreater === true) {
|
||||
// As per https://matrix.org/docs/spec/client_server/r0.6.0#m-room-power-levels
|
||||
const currentPl = (
|
||||
powerLevels.content.users && powerLevels.content.users[userId]
|
||||
) || powerLevels.content.users_default || 0;
|
||||
|
||||
const currentPl = powerLevels.users?.[userId] ?? powerLevels.users_default ?? 0;
|
||||
if (currentPl >= level) {
|
||||
return sendResponse(event, {
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user