mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 20:59:27 +01:00
I thought this already sorted by id...
This commit is contained in:
parent
ef550c2dc0
commit
62f3242b81
@ -322,7 +322,7 @@ class Note(callbacks.Privmsg):
|
||||
temp[note[1]] = [note[0]]
|
||||
notes = []
|
||||
for (k,v) in temp.iteritems():
|
||||
notes.append('%s %s' % (', '.join(v), k))
|
||||
notes.append('%s %s' % (utils.commaAndify(v), k))
|
||||
return notes
|
||||
|
||||
def _sentnotes(self, irc, msg, receiver):
|
||||
@ -345,6 +345,7 @@ class Note(callbacks.Privmsg):
|
||||
irc.error('That user is not in my user database.')
|
||||
return
|
||||
sql = '%s %s' % (sql, 'AND notes.to_id=%r' % receiver)
|
||||
sql = '%s ORDER BY id DESC' % sql
|
||||
db = self.dbHandler.getDb()
|
||||
cursor = db.cursor()
|
||||
cursor.execute(sql)
|
||||
@ -377,6 +378,7 @@ class Note(callbacks.Privmsg):
|
||||
irc.error('That user is not in my user database.')
|
||||
return
|
||||
sql = '%s %s' % (sql, 'AND notes.from_id=%r' % sender)
|
||||
sql = '%s ORDER BY id DESC' % sql
|
||||
db = self.dbHandler.getDb()
|
||||
cursor = db.cursor()
|
||||
cursor.execute(sql)
|
||||
@ -386,7 +388,6 @@ class Note(callbacks.Privmsg):
|
||||
else:
|
||||
ids = [self._formatNoteData(msg, *t) for t in cursor.fetchall()]
|
||||
#self.log.warning(ids)
|
||||
ids.reverse()
|
||||
ids = self._condense(ids)
|
||||
irc.reply(utils.commaAndify(ids))
|
||||
|
||||
|
@ -70,7 +70,7 @@ if sqlite is not None:
|
||||
_ = self.getMsg(' ')
|
||||
self.assertNotError('note send inkedmn 1,2,3')
|
||||
_ = self.getMsg(' ')
|
||||
self.assertRegexp('note list --sent', r'#1.*#2')
|
||||
self.assertRegexp('note list --sent', r'#2.*#1')
|
||||
self.assertRegexp('note list', r'#1.*#2')
|
||||
self.assertRegexp('note 1', 'testing')
|
||||
self.assertResponse('note list --old', '#1 from inkedmn')
|
||||
|
Loading…
Reference in New Issue
Block a user