setPowerLevel in MatrixClient no longer requires old event
This commit is contained in:
parent
972c80c65d
commit
ae312db784
1 changed files with 3 additions and 12 deletions
|
|
@ -637,10 +637,7 @@ export default {
|
||||||
if (this.matrixClient && roomId && userId) {
|
if (this.matrixClient && roomId && userId) {
|
||||||
const room = this.getRoom(roomId);
|
const room = this.getRoom(roomId);
|
||||||
if (room && room.currentState) {
|
if (room && room.currentState) {
|
||||||
const powerLevelEvent = room.currentState.getStateEvents("m.room.power_levels", "");
|
this.matrixClient.setPowerLevel(roomId, userId, 100);
|
||||||
if (powerLevelEvent) {
|
|
||||||
this.matrixClient.setPowerLevel(roomId, userId, 100, powerLevelEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -650,10 +647,7 @@ export default {
|
||||||
const room = this.getRoom(roomId);
|
const room = this.getRoom(roomId);
|
||||||
console.log("Room", room);
|
console.log("Room", room);
|
||||||
if (room && room.currentState) {
|
if (room && room.currentState) {
|
||||||
const powerLevelEvent = room.currentState.getStateEvents("m.room.power_levels", "");
|
this.matrixClient.setPowerLevel(roomId, userId, 50);
|
||||||
if (powerLevelEvent) {
|
|
||||||
this.matrixClient.setPowerLevel(roomId, userId, 50, powerLevelEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -662,10 +656,7 @@ export default {
|
||||||
if (this.matrixClient && roomId && userId) {
|
if (this.matrixClient && roomId && userId) {
|
||||||
const room = this.getRoom(roomId);
|
const room = this.getRoom(roomId);
|
||||||
if (room && room.currentState) {
|
if (room && room.currentState) {
|
||||||
const powerLevelEvent = room.currentState.getStateEvents("m.room.power_levels", "");
|
this.matrixClient.setPowerLevel(roomId, userId, 0);
|
||||||
if (powerLevelEvent) {
|
|
||||||
this.matrixClient.setPowerLevel(roomId, userId, 0, powerLevelEvent);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue