diff options
author | jimpop@template.hostname <> | 2015-11-04 22:49:05 +0000 |
---|---|---|
committer | jimpop@template.hostname <> | 2015-11-04 22:49:05 +0000 |
commit | b8811f8fc2d9bd27d1963c000ddaf05d951b5bda (patch) | |
tree | b3447d4398422a86c259280b86f3f3e2b7c2b973 /Mailman/Utils.py | |
parent | a777ae450ed966ca75f22c140fee938c5fd37996 (diff) | |
download | mailman2-b8811f8fc2d9bd27d1963c000ddaf05d951b5bda.tar.gz mailman2-b8811f8fc2d9bd27d1963c000ddaf05d951b5bda.tar.xz mailman2-b8811f8fc2d9bd27d1963c000ddaf05d951b5bda.zip |
Improvements based on feedback from Mark Sapiro
https://code.launchpad.net/~jimpop/mailman/mailman-auto-mod-verbose-members/+merge/276706/comments/699744
Diffstat (limited to '')
-rw-r--r-- | Mailman/Utils.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Mailman/Utils.py b/Mailman/Utils.py index a4eb05da..70ef34e8 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -1250,21 +1250,19 @@ def IsDMARCProhibited(mlist, email): recentMemberPostings = {}; def IsVerboseMember(mlist, email): - threshold = 5 if mlist.member_verbosity_threshold is None else mlist.member_verbosity_threshold - if threshold == 0: + if mlist.member_verbosity_threshold == 0: return False - interval = 5 if mlist.member_verbosity_interval is None else mlist.member_verbosity_interval email = email.lower() t = time.time() recentMemberPostings.setdefault(email,[]).append(t) for t in recentMemberPostings[email]: - if t < time.time() - float(interval): + if t < time.time() - float(mlist.member_verbosity_interval): recentMemberPostings[email].remove(t) - return len(recentMemberPostings[email]) >= threshold + return len(recentMemberPostings[email]) >= mlist.member_verbosity_threshold def check_eq_domains(email, domains_list): |