Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow error strings from spam checker #2531

Merged
merged 2 commits into from Oct 12, 2017

Conversation

Projects
None yet
2 participants
Member

dbkr commented Oct 11, 2017 edited

This is a fairly crude way of getting this information to the user, but I'm not sure what would work better

synapse/handlers/message.py
- if self.spam_checker.check_event_for_spam(event):
+ spam_error = self.spam_checker.check_event_for_spam(event)
+ if spam_error:
+ if not isinstance(spam_error, (str, basestring)):
@erikjohnston

erikjohnston Oct 11, 2017

Owner

I think isinstance(spam_error, basestring) works fine?

@dbkr dbkr merged commit b8d8ed1 into develop Oct 12, 2017

6 of 8 checks passed

Sytest Dendron (Commit) Build #2757 origin/dbkr/spamcheck_error_messages failed in 3 min 26 sec
Details
Sytest Dendron (Merged PR) Build finished.
Details
Sytest Postgres (Commit) Build #3591 origin/dbkr/spamcheck_error_messages succeeded in 3 min 14 sec
Details
Sytest Postgres (Merged PR) Build finished.
Details
Sytest SQLite (Commit) Build #3689 origin/dbkr/spamcheck_error_messages succeeded in 1 min 47 sec
Details
Sytest SQLite (Merged PR) Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@dbkr dbkr deleted the dbkr/spamcheck_error_messages branch Oct 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment