From 37b6c1351d9ddd56800e0250e8c1bb3f5e69427e Mon Sep 17 00:00:00 2001 From: kongr45gpen Date: Thu, 1 Aug 2013 14:12:11 +0300 Subject: Add showMilestone configuration variable Lower the length of the shown message --- plugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'plugin.py') 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']), -- cgit v1.2.3