From 86147ded77531c8a9b47a2033b697096c6c861be Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 18 Oct 2019 14:03:20 +0100 Subject: pass git_webhook urls up to __init__.py to be shortened --- modules/git_webhooks/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'modules/git_webhooks/__init__.py') diff --git a/modules/git_webhooks/__init__.py b/modules/git_webhooks/__init__.py index 721b2a26..d43c310a 100644 --- a/modules/git_webhooks/__init__.py +++ b/modules/git_webhooks/__init__.py @@ -118,10 +118,15 @@ class Module(ModuleManager.BaseModule): if repo_name and hide_org: source = repo_name - for output in outputs: + for output, url in outputs: output = "(%s) %s" % ( utils.irc.color(source, colors.COLOR_REPO), output) + if url: + shorturl = self.exports.get_one("shorturl")(server, url, + context=channel) or url + output = "%s - %s" % (output, shorturl) + if channel.get_setting("git-prevent-highlight", False): output = self._prevent_highlight(server, channel, output) -- cgit v1.3.1-10-gc9f91