mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-14 04:37:00 +00:00
fix: Stop applying MSC4155 invite filtering to outgoing invites
This commit is contained in:
1 parent
4dc7e06c90
commit
c731ec5421
3 files changed
+12
-14
No files matched your search
@@ -0,0 +1 @@
|
||||
Fixed MSC4155 invite filtering being applied to outgoing invites, which prevented users from inviting anyone they had blocked or ignored invites from. Contributed by @eleboucher.
|
||||
@@ -49,13 +49,12 @@ pub(crate) async fn invite_user_route(
|
||||
reason,
|
||||
..
|
||||
}) => {
|
||||
let sender_filter_level = services
|
||||
// silently drop invites to users the sender has ignored
|
||||
if services
|
||||
.users
|
||||
.invite_filter_level(recipient_user, sender_user)
|
||||
.await;
|
||||
|
||||
if !matches!(sender_filter_level, FilterLevel::Allow) {
|
||||
// drop invites if the sender has the recipient filtered
|
||||
.user_is_ignored(recipient_user, sender_user)
|
||||
.await
|
||||
{
|
||||
return Ok(invite_user::v3::Response::new());
|
||||
}
|
||||
|
||||
|
||||
@@ -156,14 +156,12 @@ pub(crate) async fn create_room_route(
|
||||
let mut invitees = BTreeSet::new();
|
||||
|
||||
for recipient_user in &body.invite {
|
||||
if !matches!(
|
||||
services
|
||||
.users
|
||||
.invite_filter_level(recipient_user, sender_user)
|
||||
.await,
|
||||
FilterLevel::Allow
|
||||
) {
|
||||
// drop invites if the creator has them blocked
|
||||
// silently drop invites to users the creator has ignored
|
||||
if services
|
||||
.users
|
||||
.user_is_ignored(recipient_user, sender_user)
|
||||
.await
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user