Our current behavior is bad. We don't check whether the new user is banned, and so the plan attempts to join banned rooms (which will fail).
70 lines
1.9 KiB
Text
70 lines
1.9 KiB
Text
// New user is banned from a room that the old user is joined to. We should
|
|
// generate an error.
|
|
{
|
|
"rooms": {
|
|
"!simple-room:example.com": [
|
|
{
|
|
"type": "m.room.member",
|
|
"state_key": "@old:example.com",
|
|
"content": {
|
|
"membership": "join"
|
|
}
|
|
},
|
|
{
|
|
"type": "m.room.member",
|
|
"state_key": "@new:example.com",
|
|
"content": {
|
|
"membership": "ban"
|
|
}
|
|
},
|
|
{
|
|
"type": "m.room.join_rules",
|
|
"state_key": "",
|
|
"content": {
|
|
"join_rule": "public"
|
|
}
|
|
}
|
|
],
|
|
|
|
// Even when the old user has permissions to unban the new user, we
|
|
// don't want to do that automatically
|
|
"!mod-room:example.com": [
|
|
{
|
|
"type": "m.room.member",
|
|
"state_key": "@old:example.com",
|
|
"content": {
|
|
"membership": "join"
|
|
}
|
|
},
|
|
{
|
|
"type": "m.room.member",
|
|
"state_key": "@new:example.com",
|
|
"content": {
|
|
"membership": "ban"
|
|
}
|
|
},
|
|
{
|
|
"type": "m.room.join_rules",
|
|
"state_key": "",
|
|
"content": {
|
|
"join_rule": "public"
|
|
}
|
|
},
|
|
{
|
|
"type": "m.room.power_levels",
|
|
"state_key": "",
|
|
"content": {
|
|
"users": {
|
|
"@old:example.com": 100
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"old_user": {
|
|
"user_id": "@old:example.com"
|
|
},
|
|
"new_user": {
|
|
"user_id": "@new:example.com"
|
|
}
|
|
}
|