mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-13 10:40:28 +03:00
Add ability to change power level in profile viewer
Signed-off-by: Ajay Bura <ajbura@gmail.com>
This commit is contained in:
parent
3f39fd487f
commit
12f2eed5b3
3 changed files with 73 additions and 9 deletions
|
|
@ -199,6 +199,16 @@ async function kick(roomId, userId) {
|
|||
return result;
|
||||
}
|
||||
|
||||
async function setPowerLevel(roomId, userId, powerLevel) {
|
||||
const mx = initMatrix.matrixClient;
|
||||
const room = mx.getRoom(roomId);
|
||||
|
||||
const powerlevelEvent = room.currentState.getStateEvents('m.room.power_levels')[0];
|
||||
|
||||
const result = await mx.setPowerLevel(roomId, userId, powerLevel, powerlevelEvent);
|
||||
return result;
|
||||
}
|
||||
|
||||
function createSpaceShortcut(roomId) {
|
||||
appDispatcher.dispatch({
|
||||
type: cons.actions.room.CREATE_SPACE_SHORTCUT,
|
||||
|
|
@ -216,5 +226,6 @@ function deleteSpaceShortcut(roomId) {
|
|||
export {
|
||||
join, leave,
|
||||
create, invite, kick,
|
||||
setPowerLevel,
|
||||
createSpaceShortcut, deleteSpaceShortcut,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue