aboutsummaryrefslogtreecommitdiffstats
path: root/plugin.py
diff options
context:
space:
mode:
authorkongr45gpen <kongr45gpen@helit.org>2013-08-01 14:12:11 +0300
committerkongr45gpen <kongr45gpen@helit.org>2013-08-01 14:12:11 +0300
commit37b6c1351d9ddd56800e0250e8c1bb3f5e69427e (patch)
tree0d5c18f1e76913f666579f66f6b5eaa1f9aaa486 /plugin.py
parent472155a60589820058f539efe6d77affa3ba061c (diff)
downloadsupybot_github-37b6c1351d9ddd56800e0250e8c1bb3f5e69427e.tar.gz
supybot_github-37b6c1351d9ddd56800e0250e8c1bb3f5e69427e.tar.bz2
supybot_github-37b6c1351d9ddd56800e0250e8c1bb3f5e69427e.zip
Add showMilestone configuration variable
Lower the length of the shown message
Diffstat (limited to 'plugin.py')
-rw-r--r--plugin.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/plugin.py b/plugin.py
index e8cf51c..ddfda65 100644
--- a/plugin.py
+++ b/plugin.py
@@ -300,7 +300,7 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
creator = " by %s" % (ircutils.mircColor(data['issue']['user']['login'],"green"),)
milestone = ''
- if data['issue']['milestone']:
+ if data['issue']['milestone'] and configValue("showMilestone"):
milestone = ircutils.mircColor(" (%s" % (data['issue']['milestone']['title']),"brown")
if milestone:
@@ -332,7 +332,7 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
creator = " by %s" % (ircutils.mircColor(data['issue']['user']['login'],"green"),)
milestone = ''
- if data['issue']['milestone']:
+ if data['issue']['milestone'] and configValue("showMilestone"):
milestone = ircutils.mircColor(" (%s" % (data['issue']['milestone']['title']),"brown")
if milestone:
@@ -342,8 +342,10 @@ class GithubHandler(BaseHTTPServer.BaseHTTPRequestHandler):
lines = data['comment']['body'].splitlines()
line = lines[0]
- if len(line) > 100:
- line = "%s..." % (line[0:97])
+ if len(line) > 70:
+ line = "%s..." % (line[0:67])
+ elif len(lines) > 1:
+ line += "..."
msgs.append( ircmsgs.privmsg(channel, "%s: %s commented on issue %s \"%s\"%s%s %s%s): %s" % (
ircutils.bold(data['repository']['name']),

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