Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Allow spam checker to reject invites too #2492

Merged
merged 9 commits into from
Oct 3, 2017
Merged

Conversation

dbkr
Copy link
Member

@dbkr dbkr commented Oct 3, 2017

No description provided.

block_invite = True

if not self.spam_checker.user_may_invite(requester.user):
block_invite = True
Copy link
Member

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?

Copy link
Member Author

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

@@ -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):
Copy link
Member

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm, could be useful

@@ -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):
Copy link
Member

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

@dbkr dbkr merged commit 5f20a91 into develop Oct 3, 2017
@dbkr dbkr deleted the dbkr/spam_check_invites branch October 17, 2017 12:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants