mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 02:05:45 +03:00
Expose join rules of a room
This commit is contained in:
parent
31e09e6137
commit
54f21c9acc
1 changed files with 8 additions and 0 deletions
|
@ -193,6 +193,11 @@ function getMembershipState(event, roomId, userId) {
|
|||
returnStateEvent(event, roomId, "m.room.member", userId);
|
||||
}
|
||||
|
||||
function getJoinRules(event, roomId) {
|
||||
console.log(`join_rules of ${roomId} requested.`);
|
||||
returnStateEvent(event, roomId, "m.room.join_rules");
|
||||
}
|
||||
|
||||
function botOptions(event, roomId, userId) {
|
||||
console.log(`bot_options of ${userId} in room ${roomId} requested.`);
|
||||
returnStateEvent(event, roomId, "m.room.bot.options", "_" + userId);
|
||||
|
@ -256,6 +261,9 @@ const onMessage = function(event) {
|
|||
case "set_bot_options":
|
||||
setBotOptions(event, roomId, userId);
|
||||
break;
|
||||
case "join_rules_state":
|
||||
getJoinRules(event, roomId);
|
||||
break;
|
||||
default:
|
||||
console.warn("Unhandled postMessage event with action '" + event.data.action +"'");
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue