From 2778649953c9544b4ff0f2e4b50ef6d9e04a261b Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Fri, 16 Sep 2016 14:21:25 +0300 Subject: Add config option to toggle preventing issue name spam --- config.py | 4 ++++ local/utility.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/config.py b/config.py index a6f76e6..a56e3f2 100644 --- a/config.py +++ b/config.py @@ -71,4 +71,8 @@ conf.registerGlobalValue(Github, 'hideURL', registry.Boolean(False, """Whether to not display the URLs of actions""")) +conf.registerGlobalValue(Github, 'preventIssueNameSpam', + registry.Boolean(True, + """Whether to prevent the same issue name from showing up too often""")) + # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/local/utility.py b/local/utility.py index 9120104..b16646f 100644 --- a/local/utility.py +++ b/local/utility.py @@ -168,6 +168,10 @@ def showIssueName(repoId, issueId): """Returns whether we should show the issue name for a repo issue""" now = datetime.now() + if not configValue("preventIssueNameSpam"): + globals.shownIssues.clear() + return True + if not repoId in globals.shownIssues: globals.shownIssues[repoId] = {} -- cgit v1.2.3