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)
Removed extra clone() and made membership_content mutable, to change contents and reserialize to json. Signed-off-by: Jonathan Sutton <jonathansutton91@proton.me>
This commit is contained in:
committed by
Ellis Git
parent
098e8a0b92
commit
e94e614498
@@ -367,7 +367,7 @@ async fn allowed_to_send_state_event(
|
||||
}
|
||||
},
|
||||
| StateEventType::RoomMember => match json.deserialize_as::<RoomMemberEventContent>() {
|
||||
| Ok(membership_content) => {
|
||||
| Ok(mut membership_content) => {
|
||||
let Ok(state_key) = UserId::parse(state_key) else {
|
||||
return Err!(Request(BadJson(
|
||||
"Membership event has invalid or non-existent state key"
|
||||
@@ -382,10 +382,9 @@ async fn allowed_to_send_state_event(
|
||||
.is_joined(state_key, room_id)
|
||||
.await
|
||||
{
|
||||
let mut content: RoomMemberEventContent = membership_content.clone();
|
||||
content.join_authorized_via_users_server = None;
|
||||
membership_content.join_authorized_via_users_server = None;
|
||||
*json = Raw::<AnyStateEventContent>::from_json_string(
|
||||
serde_json::to_string(&content)?,
|
||||
serde_json::to_string(&membership_content)?,
|
||||
)?;
|
||||
} else if let Some(authorising_user) =
|
||||
membership_content.join_authorized_via_users_server
|
||||
|
||||
Reference in New Issue
Block a user