From 3aa8bdcf187a9ea9a6f044e0d7be0786394bf36e Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Wed, 22 Sep 2004 21:29:23 +0000 Subject: [PATCH] Fixed unsend bugz0r. --- plugins/Note.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/plugins/Note.py b/plugins/Note.py index 74d15689d..db1232584 100644 --- a/plugins/Note.py +++ b/plugins/Note.py @@ -153,6 +153,13 @@ class DbiNoteDB(dbi.DB): self._addCache(n) 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}) @@ -300,7 +307,7 @@ class Note(callbacks.Privmsg): note = self.db.get(id) if note.frm == userid: if not note.read: - self.db.remove(id) + self.db.unsend(id) irc.replySuccess() else: irc.error('That note has been read already.')