Expose join rules of a room
parent
31e09e6137
commit
54f21c9acc
|
@ -193,6 +193,11 @@ function getMembershipState(event, roomId, userId) {
|
||||||
returnStateEvent(event, roomId, "m.room.member", 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) {
|
function botOptions(event, roomId, userId) {
|
||||||
console.log(`bot_options of ${userId} in room ${roomId} requested.`);
|
console.log(`bot_options of ${userId} in room ${roomId} requested.`);
|
||||||
returnStateEvent(event, roomId, "m.room.bot.options", "_" + userId);
|
returnStateEvent(event, roomId, "m.room.bot.options", "_" + userId);
|
||||||
|
@ -256,6 +261,9 @@ const onMessage = function(event) {
|
||||||
case "set_bot_options":
|
case "set_bot_options":
|
||||||
setBotOptions(event, roomId, userId);
|
setBotOptions(event, roomId, userId);
|
||||||
break;
|
break;
|
||||||
|
case "join_rules_state":
|
||||||
|
getJoinRules(event, roomId);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
console.warn("Unhandled postMessage event with action '" + event.data.action +"'");
|
console.warn("Unhandled postMessage event with action '" + event.data.action +"'");
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue