mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Fixed unsend bugz0r.
This commit is contained in:
parent
99e35d6810
commit
3aa8bdcf18
@ -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.')
|
||||||
|
Loading…
Reference in New Issue
Block a user