Fixed unsend bugz0r.

This commit is contained in:
Jeremy Fincher 2004-09-22 21:29:23 +00:00
parent 99e35d6810
commit 3aa8bdcf18

View File

@ -153,6 +153,13 @@ class DbiNoteDB(dbi.DB):
self._addCache(n) self._addCache(n)
return id return id
def unsend(self, id):
self.remove(id)
for cache in self.unRead, self.unNotified:
for (to, ids) in cache.items():
while id in ids:
ids.remove(id)
NoteDB = plugins.DB('Note', {'flat': DbiNoteDB}) NoteDB = plugins.DB('Note', {'flat': DbiNoteDB})
@ -300,7 +307,7 @@ class Note(callbacks.Privmsg):
note = self.db.get(id) note = self.db.get(id)
if note.frm == userid: if note.frm == userid:
if not note.read: if not note.read:
self.db.remove(id) self.db.unsend(id)
irc.replySuccess() irc.replySuccess()
else: else:
irc.error('That note has been read already.') irc.error('That note has been read already.')