Began switch to allow notifications.

This commit is contained in:
Jeremy Fincher 2003-04-15 19:11:12 +00:00
parent f67fa45395
commit 82c7d586ef

View File

@ -82,6 +82,7 @@ class Notes(callbacks.Privmsg):
from_id INTEGER, from_id INTEGER,
to_id INTEGER, to_id INTEGER,
added_at TIMESTAMP, added_at TIMESTAMP,
notified BOOLEAN,
read BOOLEAN, read BOOLEAN,
public BOOLEAN, public BOOLEAN,
note TEXT note TEXT
@ -111,7 +112,9 @@ class Notes(callbacks.Privmsg):
def setAsRead(self, noteid): def setAsRead(self, noteid):
"Changes a message's 'read' value to true in the notes table." "Changes a message's 'read' value to true in the notes table."
self.cursor.execute('UPDATE notes SET read=1 WHERE id=%s', noteid) self.cursor.execute("""UPDATE notes
SET read=1, notified=1
WHERE id=%s""", noteid)
self.db.commit() self.db.commit()
def die(self): def die(self):
@ -139,9 +142,9 @@ class Notes(callbacks.Privmsg):
else: else:
public = 0 public = 0
self.cursor.execute("""INSERT INTO notes VALUES self.cursor.execute("""INSERT INTO notes VALUES
(NULL, %s, %s, %s, %s, %s, %s)""", (NULL, %s, %s, %s, 0, 0, %s, %s)""",
senderID, recipID, int(time.time()), senderID, recipID, int(time.time()),
0, public, note) public, note)
self.db.commit() self.db.commit()
irc.reply(msg, conf.replySuccess) irc.reply(msg, conf.replySuccess)