Fixed some bugs with note orders, etc.

This commit is contained in:
Jeremy Fincher 2004-08-07 00:48:03 +00:00
parent ec16cf9622
commit 52cbec4838
2 changed files with 34 additions and 37 deletions

View File

@ -394,6 +394,7 @@ class Note(callbacks.Privmsg):
return
notesAndIds = self.db.notes(p)
notesAndIds.sort()
#notesAndIds.reverse() # Newer notes, higher ids.
if not notesAndIds:
irc.reply('You have no unread notes.')
else:
@ -434,6 +435,7 @@ class Note(callbacks.Privmsg):
return originalP(note) and note.to == receiver
notesAndIds = self.db.notes(p)
notesAndIds.sort()
notesAndIds.reverse()
if not notesAndIds:
irc.error('I couldn\'t find any sent notes for your user.')
else:
@ -461,6 +463,7 @@ class Note(callbacks.Privmsg):
return originalP(note) and note.frm == sender
notesAndIds = self.db.notes(p)
notesAndIds.sort()
notesAndIds.reverse()
if not notesAndIds:
irc.reply('I couldn\'t find any matching read notes for your user.')
else:

View File

@ -34,13 +34,7 @@ from testsupport import *
import supybot.utils as utils
import supybot.ircdb as ircdb
try:
import sqlite
except ImportError:
sqlite = None
if sqlite is not None:
class NoteTestCase(PluginTestCase, PluginDocumentation):
class NoteTestCase(PluginTestCase, PluginDocumentation):
plugins = ('Note', 'Misc', 'User')
def setUp(self):
PluginTestCase.setUp(self)