aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2017-01-04 00:50:12 +0200
committerkongr45gpen <electrovesta@gmail.com>2017-01-04 00:50:12 +0200
commit81fc93a87a978735130cec0011ba3fb1eec90116 (patch)
tree604cf3cc0520dd946c0f56d811c1292eef1b868d
parent7f46f55d67c50f50dc51a00d2487250c4c1e5e94 (diff)
downloadsupybot_github-81fc93a87a978735130cec0011ba3fb1eec90116.tar.gz
supybot_github-81fc93a87a978735130cec0011ba3fb1eec90116.tar.bz2
supybot_github-81fc93a87a978735130cec0011ba3fb1eec90116.zip
Show force pushes even if push display is disabled
Closes #15
-rw-r--r--config.py4
-rw-r--r--local/handler/GithubHandler.py1
-rw-r--r--local/handler/PushHandler.py4
3 files changed, 8 insertions, 1 deletions
diff --git a/config.py b/config.py
index 3e0f66c..86fd252 100644
--- a/config.py
+++ b/config.py
@@ -85,4 +85,8 @@ conf.registerChannelValue(Github, 'showPendingStatuses',
registry.Boolean(True,
"""Whether to show a message for a pending status (e.g. a build in progress)"""))
+conf.registerChannelValue(Github, 'alwaysShowForcedPushes',
+ registry.Boolean(True,
+ """Whether to always show force-pushes, even if hidePush is set to True"""))
+
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
diff --git a/local/handler/GithubHandler.py b/local/handler/GithubHandler.py
index ce6edd2..6a7d075 100644
--- a/local/handler/GithubHandler.py
+++ b/local/handler/GithubHandler.py
@@ -41,6 +41,7 @@ import IssueCommentHandler
from .. import theme as themes
+#TODO: Use a better name and location for this
class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(s):
"""Respond to a POST request."""
diff --git a/local/handler/PushHandler.py b/local/handler/PushHandler.py
index 13052a3..903b1b6 100644
--- a/local/handler/PushHandler.py
+++ b/local/handler/PushHandler.py
@@ -46,7 +46,9 @@ def handle(data, theme):
regularCommitCount = len(data['commits']) - mergedCommitCount
isMerge = True
- if configValue("hidePush",None) == False and not branched:
+ visible = configValue("hidePush") == False or (configValue("alwaysShowForcedPushes") == True and data['forced'])
+
+ if visible and not branched:
theme.push(
branch = branch,
actor = data['pusher']['name'],

© 2014-2024 Faster IT GmbH | imprint | privacy policy