diff --git a/plugins/URLSnarfer.py b/plugins/URLSnarfer.py index 0de32e9bc..a7bbc0510 100644 --- a/plugins/URLSnarfer.py +++ b/plugins/URLSnarfer.py @@ -45,6 +45,7 @@ import urlparse import sqlite import utils +import ircmsgs import privmsgs import callbacks @@ -115,7 +116,11 @@ class URLSnarfer(callbacks.Privmsg, ChannelDBHandler): cursor.execute("""UPDATE urls SET next_msg=%s WHERE url=%s AND added=%s""", msg.args[1], url, added) - for url in self._urlRe.findall(msg.args[1]): + if ircmsgs.isAction(msg): + text = ircmsgs.unAction(msg) + else: + text = msg.args[1] + for url in self._urlRe.findall(text): (protocol, site, filename, _, _, _) = urlparse.urlparse(url) previousMsg = '' for oldMsg in reviter(irc.state.history): diff --git a/test/test_URLSnarfer.py b/test/test_URLSnarfer.py index a199fce65..f684b9df1 100644 --- a/test/test_URLSnarfer.py +++ b/test/test_URLSnarfer.py @@ -85,6 +85,10 @@ class URLSnarferTestCase(ChannelPluginTestCase, PluginDocumentation): self.assertRegexp('lasturl --with dhcp', re.escape(urls[-4])) self.assertRegexp('lasturl --from alsdkjf', '^No') self.assertNotError('randomurl') + + def testAction(self): + self.irc.feedMsg(ircmsgs.action(self.channel, urls[1])) + self.assertNotRegexp('lasturl', '\\x01')