fix(membership): remove join_authorized_via_users_server field on state update

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
Matthias Ahouansou 2024-04-03 18:45:45 -04:00 committed by June
parent 172d71e365
commit 68e64392f0
2 changed files with 4 additions and 0 deletions

View File

@ -310,6 +310,7 @@ pub async fn ban_user_route(body: Ruma<ban_user::v3::Request>) -> Result<ban_use
.unwrap_or_default(),
blurhash: services().users.blurhash(&body.user_id).unwrap_or_default(),
reason: body.reason.clone(),
join_authorized_via_users_server: None,
..event
})
.map_err(|_| Error::bad_database("Invalid member event in database."))
@ -368,6 +369,7 @@ pub async fn unban_user_route(body: Ruma<unban_user::v3::Request>) -> Result<unb
event.membership = MembershipState::Leave;
event.reason.clone_from(&body.reason);
event.join_authorized_via_users_server = None;
let mutex_state = Arc::clone(
services()

View File

@ -42,6 +42,7 @@ pub async fn set_displayname_route(
event_type: TimelineEventType::RoomMember,
content: to_raw_value(&RoomMemberEventContent {
displayname: body.displayname.clone(),
join_authorized_via_users_server: None,
..serde_json::from_str(
services()
.rooms
@ -179,6 +180,7 @@ pub async fn set_avatar_url_route(body: Ruma<set_avatar_url::v3::Request>) -> Re
event_type: TimelineEventType::RoomMember,
content: to_raw_value(&RoomMemberEventContent {
avatar_url: body.avatar_url.clone(),
join_authorized_via_users_server: None,
..serde_json::from_str(
services()
.rooms