-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow spam checker to reject invites too #2492
Conversation
synapse/handlers/room_member.py
Outdated
block_invite = True | ||
|
||
if not self.spam_checker.user_may_invite(requester.user): | ||
block_invite = True |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want this to apply to server admins?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, I guess not actually
synapse/events/spamcheck.py
Outdated
@@ -45,3 +45,19 @@ def check_event_for_spam(self, event): | |||
return False | |||
|
|||
return self.spam_checker.check_event_for_spam(event) | |||
|
|||
def user_may_invite(self, userid): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we also want to include the room_id here, so that you can fonx all invites for known bad rooms (or whitelist known good rooms)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm, could be useful
synapse/events/spamcheck.py
Outdated
@@ -45,3 +45,19 @@ def check_event_for_spam(self, event): | |||
return False | |||
|
|||
return self.spam_checker.check_event_for_spam(event) | |||
|
|||
def user_may_invite(self, userid, roomid): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally we call it room_id
No description provided.