From 1b5d10d676fa93c2bf979af99089c87e9dc99b53 Mon Sep 17 00:00:00 2001 From: Dunedan Date: Sun, 8 Sep 2024 13:43:45 +0200 Subject: [PATCH] Resolve issue ids using Gitea instead of Trac --- config.py | 2 +- plugin.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config.py b/config.py index 2403daf..f51ed93 100755 --- a/config.py +++ b/config.py @@ -45,7 +45,7 @@ def configure(advanced): conf.registerPlugin('wfg', True) wfg.ticketUrl.setValue( - something("Specify the URL of the ticketing system instance.", default="https://trac.wildfiregames.com/")) + something("Specify the URL of the ticketing system instance.", default="https://gitea.wildfiregames.com/0ad/0ad/issues/")) wfg.channels.setValue( anything("On which irc channels the bot should answer to #. If empty, prints on each joined channel.", default="", acceptEmpty=True)) diff --git a/plugin.py b/plugin.py index f241d4f..ea92adf 100755 --- a/plugin.py +++ b/plugin.py @@ -75,7 +75,7 @@ def doPrivmsg(self, irc, msg): if matchobj is not None: ticket_number = matchobj.group(0).lstrip('#') ticket_url = self.registryValue('ticketUrl') - url = f'{ticket_url.rstrip("/")}/ticket/{ticket_number}' + url = f'{ticket_url.rstrip("/")}/{ticket_number}' # Fetch the title of the ticket page try: @@ -85,11 +85,11 @@ def doPrivmsg(self, irc, msg): parser.feed(html) title = parser.title if parser.title else "No title found" # Clean up the title if necessary - title = re.sub(r'\s*–\s*Wildfire Games\s*$', '', title) + title = re.sub(r'\s-\s0ad\s-\s*Wildfire Games\s*$', '', title) except Exception as e: return - response = f'{title} – {url}' + response = f'{title} – {response.url}' irc.queueMsg(ircmsgs.privmsg(channel, response)) Class = wfg