diff --git a/earwigbot/irc/rc.py b/earwigbot/irc/rc.py index 67c0080..828a31d 100644 --- a/earwigbot/irc/rc.py +++ b/earwigbot/irc/rc.py @@ -33,7 +33,8 @@ class RC(object): pretty_edit = "\x02New {0}\x0F: \x0314[[\x0307{1}\x0314]]\x0306 * \x0303{2}\x0306 * \x0302{3}\x0306 * \x0310{4}" pretty_log = "\x02New {0}\x0F: \x0303{1}\x0306 * \x0302{2}\x0306 * \x0310{3}" - def __init__(self, msg): + def __init__(self, chan, msg): + self.chan = chan self.msg = msg def parse(self): @@ -51,7 +52,7 @@ class RC(object): # We're probably missing the http:// part, because it's a log # entry, which lacks a URL: page, flags, user, comment = self.re_log.findall(msg)[0] - url = "".join(("http://en.wikipedia.org/wiki/", page)) + url = "http://{0}.org/wiki/{1}".format(self.chan, page) self.is_edit = False # This is a log entry, not edit diff --git a/earwigbot/irc/watcher.py b/earwigbot/irc/watcher.py index 8a45dff..a508af5 100644 --- a/earwigbot/irc/watcher.py +++ b/earwigbot/irc/watcher.py @@ -61,7 +61,7 @@ class Watcher(IRCConnection): return msg = " ".join(line[3:])[1:] - rc = RC(msg) # New RC object to store this event's data + rc = RC(chan, msg) # New RC object to store this event's data rc.parse() # Parse a message into pagenames, usernames, etc. self._process_rc_event(rc)