mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Added the note ids that are unread to the notification message.
This commit is contained in:
parent
2ca430403f
commit
206d8bd527
@ -135,16 +135,19 @@ class Note(callbacks.Privmsg):
|
|||||||
return
|
return
|
||||||
db = self.dbHandler.getDb()
|
db = self.dbHandler.getDb()
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
cursor.execute("""SELECT COUNT(*) FROM notes
|
cursor.execute("""SELECT id FROM notes
|
||||||
WHERE notes.to_id=%s AND notified=0""", id)
|
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:
|
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)
|
WHERE notes.to_id=%s AND read=0""", id)
|
||||||
unread = int(cursor.fetchone()[0])
|
unreadIds = ['#%s' % t[0] for t in cursor.fetchall()]
|
||||||
s = 'You have %s; ' \
|
unread = len(unreadIds)
|
||||||
'%s that I haven\'t told you about before now..' % \
|
s = 'You have %s; %s that I haven\'t told you about before now. '\
|
||||||
(utils.nItems('note', unread, 'unread'), unnotified)
|
'%s %s still unread.' % \
|
||||||
|
(utils.nItems('note', unread, 'unread'), unnotified,
|
||||||
|
utils.commaAndify(unreadIds), utils.be(unread))
|
||||||
maker = ircmsgs.privmsg
|
maker = ircmsgs.privmsg
|
||||||
if self.userValue('notifyWithNotice', msg.prefix):
|
if self.userValue('notifyWithNotice', msg.prefix):
|
||||||
maker = ircmsgs.notice
|
maker = ircmsgs.notice
|
||||||
|
Loading…
Reference in New Issue
Block a user