aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkongr45gpen <electrovesta@gmail.com>2016-07-30 20:48:09 +0300
committerkongr45gpen <electrovesta@gmail.com>2016-07-30 20:48:09 +0300
commit93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50 (patch)
tree2e6da93fa5b4fba10d9b0e9a72afb22602c52330
parente5d698ab769bb03340d83e253721c6c3f56ade01 (diff)
downloadsupybot_github-93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50.tar.gz
supybot_github-93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50.tar.bz2
supybot_github-93beeec8ceb8cb62c1da3ae5239e4299ebf3dc50.zip
Add a config value to hide URLs
-rw-r--r--config.py4
-rw-r--r--local/theme/Theme.py3
-rw-r--r--local/utility.py2
3 files changed, 9 insertions, 0 deletions
diff --git a/config.py b/config.py
index eba5b61..a6f76e6 100644
--- a/config.py
+++ b/config.py
@@ -67,4 +67,8 @@ conf.registerGlobalValue(Github, 'allowArbitraryMessages',
registry.Boolean(False,
"""Whether to allow parsing and showing arbitrary messages sent by a client"""))
+conf.registerGlobalValue(Github, 'hideURL',
+ registry.Boolean(False,
+ """Whether to not display the URLs of actions"""))
+
# vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79:
diff --git a/local/theme/Theme.py b/local/theme/Theme.py
index ecad213..c209e49 100644
--- a/local/theme/Theme.py
+++ b/local/theme/Theme.py
@@ -8,4 +8,7 @@ class Theme(object):
pass
def enclose(self, text):
+ if text == None or text == '':
+ #TODO: Remove the space before the URL
+ return ""
return "%s%s%s" % (self.brackets[0], text, self.brackets[1])
diff --git a/local/utility.py b/local/utility.py
index a1d41bd..065be0f 100644
--- a/local/utility.py
+++ b/local/utility.py
@@ -97,6 +97,8 @@ def colorAction(action):
def getShortURL(longurl):
""" Returns a short URL generated by git.io"""
+ if configValue("hideURL") is True:
+ return None
if configValue("shortURL") is False or not getShortURL.github.match(longurl):
url = longurl
else:

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