mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +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 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):
|
||||
|
@ -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')
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user