|
|
@ -165,7 +165,7 @@ pub async fn invite_user_route(
|
|
|
|
if let invite_user::IncomingInvitationRecipient::UserId { user_id } = &body.recipient {
|
|
|
|
if let invite_user::IncomingInvitationRecipient::UserId { user_id } = &body.recipient {
|
|
|
|
invite_helper(sender_user, user_id, &body.room_id, &db, false).await?;
|
|
|
|
invite_helper(sender_user, user_id, &body.room_id, &db, false).await?;
|
|
|
|
db.flush().await?;
|
|
|
|
db.flush().await?;
|
|
|
|
Ok(invite_user::Response.into())
|
|
|
|
Ok(invite_user::Response {}.into())
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Err(Error::BadRequest(ErrorKind::NotFound, "User not found."))
|
|
|
|
Err(Error::BadRequest(ErrorKind::NotFound, "User not found."))
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -261,6 +261,7 @@ pub async fn ban_user_route(
|
|
|
|
avatar_url: db.users.avatar_url(&body.user_id)?,
|
|
|
|
avatar_url: db.users.avatar_url(&body.user_id)?,
|
|
|
|
is_direct: None,
|
|
|
|
is_direct: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
|
|
|
|
blurhash: db.users.blurhash(&body.user_id)?,
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
|event| {
|
|
|
|
|event| {
|
|
|
|
let mut event = serde_json::from_value::<Raw<member::MemberEventContent>>(
|
|
|
|
let mut event = serde_json::from_value::<Raw<member::MemberEventContent>>(
|
|
|
@ -556,6 +557,7 @@ async fn join_room_by_id_helper(
|
|
|
|
avatar_url: db.users.avatar_url(&sender_user)?,
|
|
|
|
avatar_url: db.users.avatar_url(&sender_user)?,
|
|
|
|
is_direct: None,
|
|
|
|
is_direct: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
|
|
|
|
blurhash: db.users.blurhash(&sender_user)?,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.expect("event is valid, we just created it"),
|
|
|
|
.expect("event is valid, we just created it"),
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -685,6 +687,7 @@ async fn join_room_by_id_helper(
|
|
|
|
avatar_url: db.users.avatar_url(&sender_user)?,
|
|
|
|
avatar_url: db.users.avatar_url(&sender_user)?,
|
|
|
|
is_direct: None,
|
|
|
|
is_direct: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
|
|
|
|
blurhash: db.users.blurhash(&sender_user)?,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
db.rooms.build_and_append_pdu(
|
|
|
|
db.rooms.build_and_append_pdu(
|
|
|
@ -833,6 +836,7 @@ pub async fn invite_helper<'a>(
|
|
|
|
is_direct: Some(is_direct),
|
|
|
|
is_direct: Some(is_direct),
|
|
|
|
membership: MembershipState::Invite,
|
|
|
|
membership: MembershipState::Invite,
|
|
|
|
third_party_invite: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
|
|
|
|
blurhash: db.users.blurhash(&sender_user)?,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.expect("member event is valid value");
|
|
|
|
.expect("member event is valid value");
|
|
|
|
|
|
|
|
|
|
|
@ -1008,6 +1012,7 @@ pub async fn invite_helper<'a>(
|
|
|
|
avatar_url: db.users.avatar_url(&user_id)?,
|
|
|
|
avatar_url: db.users.avatar_url(&user_id)?,
|
|
|
|
is_direct: Some(is_direct),
|
|
|
|
is_direct: Some(is_direct),
|
|
|
|
third_party_invite: None,
|
|
|
|
third_party_invite: None,
|
|
|
|
|
|
|
|
blurhash: db.users.blurhash(&sender_user)?,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.expect("event is valid, we just created it"),
|
|
|
|
.expect("event is valid, we just created it"),
|
|
|
|
unsigned: None,
|
|
|
|
unsigned: None,
|
|
|
|