mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
Added hostmask and added_at to the 'get' command, to reveal impostors!
This commit is contained in:
parent
abbe99fd8c
commit
54aec8d3b2
@ -210,13 +210,15 @@ class QuoteGrabs(plugins.ChannelDBHandler,
|
||||
channel = privmsgs.getChannel(msg, args)
|
||||
db = self.getDb(channel)
|
||||
cursor = db.cursor()
|
||||
cursor.execute("""SELECT quote FROM quotegrabs
|
||||
WHERE id = %s""", id)
|
||||
cursor.execute("""SELECT quote, hostmask, added_at
|
||||
FROM quotegrabs WHERE id = %s""", id)
|
||||
if cursor.rowcount == 0:
|
||||
irc.error(msg, 'No quotegrab for id %r' % id)
|
||||
return
|
||||
quote = cursor.fetchone()[0]
|
||||
irc.reply(msg, quote)
|
||||
quote, hostmask, timestamp = cursor.fetchone()
|
||||
time_str = time.strftime(conf.humanTimestampFormat,
|
||||
time.localtime(float(timestamp)))
|
||||
irc.reply(msg, '%s (Said by: %s on %s)' % (quote, hostmask, time_str))
|
||||
|
||||
|
||||
Class = QuoteGrabs
|
||||
|
@ -91,7 +91,8 @@ class QuoteGrabsTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
self.irc.feedMsg(ircmsgs.privmsg(self.channel, 'test',
|
||||
prefix=testPrefix))
|
||||
self.assertNotError('grab foo')
|
||||
self.assertResponse('quotegrabs get 1', '<foo> test')
|
||||
self.assertRegexp('quotegrabs get 1',
|
||||
'<foo> test \(Said by: foo!bar@baz on .*?\)')
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user