From 206d8bd527073e91fe713832bca6141148b0d77f Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 28 Jul 2004 20:25:11 +0000 Subject: [PATCH] Added the note ids that are unread to the notification message. --- plugins/Note.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/plugins/Note.py b/plugins/Note.py index c6f3ccd85..a1e2656a8 100644 --- a/plugins/Note.py +++ b/plugins/Note.py @@ -135,16 +135,19 @@ class Note(callbacks.Privmsg): return db = self.dbHandler.getDb() cursor = db.cursor() - cursor.execute("""SELECT COUNT(*) FROM notes + cursor.execute("""SELECT id FROM notes WHERE notes.to_id=%s AND notified=0""", id) - unnotified = int(cursor.fetchone()[0]) + unnotifiedIds = ['#%s' % t[0] for t in cursor.fetchall()] + unnotified = len(unnotifiedIds) if unnotified != 0 or repeatedly: - cursor.execute("""SELECT COUNT(*) FROM notes + cursor.execute("""SELECT id FROM notes WHERE notes.to_id=%s AND read=0""", id) - unread = int(cursor.fetchone()[0]) - s = 'You have %s; ' \ - '%s that I haven\'t told you about before now..' % \ - (utils.nItems('note', unread, 'unread'), unnotified) + unreadIds = ['#%s' % t[0] for t in cursor.fetchall()] + unread = len(unreadIds) + s = 'You have %s; %s that I haven\'t told you about before now. '\ + '%s %s still unread.' % \ + (utils.nItems('note', unread, 'unread'), unnotified, + utils.commaAndify(unreadIds), utils.be(unread)) maker = ircmsgs.privmsg if self.userValue('notifyWithNotice', msg.prefix): maker = ircmsgs.notice