mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Fixed bug with ACTIONs and added test.
This commit is contained in:
parent
8e44660692
commit
2719812074
@ -45,6 +45,7 @@ import urlparse
|
|||||||
import sqlite
|
import sqlite
|
||||||
|
|
||||||
import utils
|
import utils
|
||||||
|
import ircmsgs
|
||||||
import privmsgs
|
import privmsgs
|
||||||
import callbacks
|
import callbacks
|
||||||
|
|
||||||
@ -115,7 +116,11 @@ class URLSnarfer(callbacks.Privmsg, ChannelDBHandler):
|
|||||||
cursor.execute("""UPDATE urls SET next_msg=%s
|
cursor.execute("""UPDATE urls SET next_msg=%s
|
||||||
WHERE url=%s AND added=%s""",
|
WHERE url=%s AND added=%s""",
|
||||||
msg.args[1], url, added)
|
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)
|
(protocol, site, filename, _, _, _) = urlparse.urlparse(url)
|
||||||
previousMsg = ''
|
previousMsg = ''
|
||||||
for oldMsg in reviter(irc.state.history):
|
for oldMsg in reviter(irc.state.history):
|
||||||
|
@ -86,6 +86,10 @@ class URLSnarferTestCase(ChannelPluginTestCase, PluginDocumentation):
|
|||||||
self.assertRegexp('lasturl --from alsdkjf', '^No')
|
self.assertRegexp('lasturl --from alsdkjf', '^No')
|
||||||
self.assertNotError('randomurl')
|
self.assertNotError('randomurl')
|
||||||
|
|
||||||
|
def testAction(self):
|
||||||
|
self.irc.feedMsg(ircmsgs.action(self.channel, urls[1]))
|
||||||
|
self.assertNotRegexp('lasturl', '\\x01')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user