Closed JakubNvk closed 9 years ago
@JakubNvk this only deletes the first sticky note that can be found for a given user. Is that what you really wanted to do? I don't think so.
What I thought you'd do would be having two parameters, say nick
and id
and this command would then delete the nick
's note with id id
, provided that the user who requested deletion is the original author.
All you'd need to do would be to check if self.notes[nick][id]
exists, if event.meta['nick']
is its sender and then just delete it (hopefuly that should work).
@mrshu ping
@JakubNvk thanks for doing this but I think you overcomplicated things.
Here is how I'd go about doing it:
self.notes
self.notes[user]
self.notes
.@mrshu @JakubNvk What I would suggest is that after poping the note, we should check whether the notes list for given user is empty. It true, remove that key from self.notes
@Adman I like that idea! Added it.
@JakubNvk Thanks for the updates! Apart from those two small nitpicks this looks good!
@mrshu allright, shall I squash?
@JakubNvk go for it!
@JakubNvk feel free to merge it too =)
To: @mrshu Cc: @pepol @Adman