1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2024-11-16 17:40:50 +01:00

fix(membership): remove join_authorized_via_users_server field on state update

This commit is contained in:
Matthias Ahouansou 2024-04-03 22:42:14 +01:00
parent 24e9c99d47
commit 0f6b771cdd
No known key found for this signature in database
2 changed files with 4 additions and 0 deletions

View file

@ -270,6 +270,7 @@ pub async fn ban_user_route(body: Ruma<ban_user::v3::Request>) -> Result<ban_use
serde_json::from_str(event.content.get())
.map(|event: RoomMemberEventContent| RoomMemberEventContent {
membership: MembershipState::Ban,
join_authorized_via_users_server: None,
..event
})
.map_err(|_| Error::bad_database("Invalid member event in database."))
@ -1465,6 +1466,7 @@ pub async fn leave_room(user_id: &UserId, room_id: &RoomId, reason: Option<Strin
event.membership = MembershipState::Leave;
event.reason = reason;
event.join_authorized_via_users_server = None;
services()
.rooms

View file

@ -40,6 +40,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
@ -174,6 +175,7 @@ pub async fn set_avatar_url_route(
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