|
|
|
|
@ -161,7 +161,7 @@ pub async fn invite_user_route(
@@ -161,7 +161,7 @@ pub async fn invite_user_route(
|
|
|
|
|
if let invite_user::IncomingInvitationRecipient::UserId { user_id } = &body.recipient { |
|
|
|
|
invite_helper(sender_user, user_id, &body.room_id, &db, false).await?; |
|
|
|
|
db.flush().await?; |
|
|
|
|
Ok(invite_user::Response.into()) |
|
|
|
|
Ok(invite_user::Response {}.into()) |
|
|
|
|
} else { |
|
|
|
|
Err(Error::BadRequest(ErrorKind::NotFound, "User not found.")) |
|
|
|
|
} |
|
|
|
|
@ -244,6 +244,7 @@ pub async fn ban_user_route(
@@ -244,6 +244,7 @@ pub async fn ban_user_route(
|
|
|
|
|
avatar_url: db.users.avatar_url(&body.user_id)?, |
|
|
|
|
is_direct: None, |
|
|
|
|
third_party_invite: None, |
|
|
|
|
blurhash: None, |
|
|
|
|
}), |
|
|
|
|
|event| { |
|
|
|
|
let mut event = serde_json::from_value::<Raw<member::MemberEventContent>>( |
|
|
|
|
@ -503,6 +504,7 @@ async fn join_room_by_id_helper(
@@ -503,6 +504,7 @@ async fn join_room_by_id_helper(
|
|
|
|
|
avatar_url: db.users.avatar_url(&sender_user)?, |
|
|
|
|
is_direct: None, |
|
|
|
|
third_party_invite: None, |
|
|
|
|
blurhash: None, |
|
|
|
|
}) |
|
|
|
|
.expect("event is valid, we just created it"), |
|
|
|
|
); |
|
|
|
|
@ -639,6 +641,7 @@ async fn join_room_by_id_helper(
@@ -639,6 +641,7 @@ async fn join_room_by_id_helper(
|
|
|
|
|
avatar_url: db.users.avatar_url(&sender_user)?, |
|
|
|
|
is_direct: None, |
|
|
|
|
third_party_invite: None, |
|
|
|
|
blurhash: None, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
db.rooms.build_and_append_pdu( |
|
|
|
|
@ -774,6 +777,7 @@ pub async fn invite_helper(
@@ -774,6 +777,7 @@ pub async fn invite_helper(
|
|
|
|
|
is_direct: Some(is_direct), |
|
|
|
|
membership: MembershipState::Invite, |
|
|
|
|
third_party_invite: None, |
|
|
|
|
blurhash: None, |
|
|
|
|
}) |
|
|
|
|
.expect("member event is valid value"); |
|
|
|
|
|
|
|
|
|
@ -940,6 +944,7 @@ pub async fn invite_helper(
@@ -940,6 +944,7 @@ pub async fn invite_helper(
|
|
|
|
|
avatar_url: db.users.avatar_url(&user_id)?, |
|
|
|
|
is_direct: Some(is_direct), |
|
|
|
|
third_party_invite: None, |
|
|
|
|
blurhash: None, |
|
|
|
|
}) |
|
|
|
|
.expect("event is valid, we just created it"), |
|
|
|
|
unsigned: None, |
|
|
|
|
|