mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-05-26 20:49:55 +00:00
fix(room_member): Strip join_authorized_via_users_server (#1542)
Realized code for fix did in fact require a check for `join_authorized_via_users_server` before stripping. Otherwise, waste processing power, most of the time. Signed-off-by: Jonathan Sutton <jonathansutton91@proton.me>
This commit is contained in:
committed by
Ellis Git
parent
dab50b1ec3
commit
b9854662f3
@@ -376,6 +376,9 @@ async fn allowed_to_send_state_event(
|
|||||||
)));
|
)));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if let Some(authorising_user) =
|
||||||
|
membership_content.join_authorized_via_users_server
|
||||||
|
{
|
||||||
// join_authorized_via_users_server must be thrown away, if user is already a
|
// join_authorized_via_users_server must be thrown away, if user is already a
|
||||||
// member of the room.
|
// member of the room.
|
||||||
if services
|
if services
|
||||||
@@ -388,9 +391,9 @@ async fn allowed_to_send_state_event(
|
|||||||
*json = Raw::<AnyStateEventContent>::from_json_string(
|
*json = Raw::<AnyStateEventContent>::from_json_string(
|
||||||
serde_json::to_string(&membership_content)?,
|
serde_json::to_string(&membership_content)?,
|
||||||
)?;
|
)?;
|
||||||
} else if let Some(authorising_user) =
|
return Ok(());
|
||||||
membership_content.join_authorized_via_users_server
|
}
|
||||||
{
|
|
||||||
if membership_content.membership != MembershipState::Join {
|
if membership_content.membership != MembershipState::Join {
|
||||||
return Err!(Request(BadJson(
|
return Err!(Request(BadJson(
|
||||||
"join_authorised_via_users_server is only for member joins"
|
"join_authorised_via_users_server is only for member joins"
|
||||||
|
|||||||
Reference in New Issue
Block a user