From 63ea755d8fa82b43d4ea29164ee9ea6fb1ba601c Mon Sep 17 00:00:00 2001 From: Nicolas Coevoet Date: Wed, 30 Jun 2021 22:30:05 +0000 Subject: [PATCH] prevent a NPE on mark deletion, and avoid load of notices in +q $~a --- plugin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.py b/plugin.py index 8c97133..6419f60 100644 --- a/plugin.py +++ b/plugin.py @@ -3096,7 +3096,8 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler): i.mark(irc, item.uid, reason, prefix, self.getDb(irc.network), f, self) key = '%s%s' % (m, value) - del chan.mark[key] + if key in chan.mark: + del chan.mark[key] if irc.state.channels[channel].isHalfopPlus(irc.nick) and not self.registryValue('keepOp', channel=channel) and not chan.deopPending and not chan.deopAsked: # ask for deop, delay it a bit if not self.registryValue('doNothingAboutOwnOpStatus', channel=channel): @@ -4387,7 +4388,7 @@ class ChanTracker(callbacks.Plugin, plugins.ChannelDBHandler): chan.queue.enqueue(('-h', nick)) if nick in irc.state.channels[channel].voices and not nick == irc.nick: chan.queue.enqueue(('-v', nick)) - if m == 'q' and len(self.registryValue('quietMessage', channel=channel)) and not chan.attacked: + if m == 'q' and len(self.registryValue('quietMessage', channel=channel)) and not chan.attacked and not value == '$~a': qm = self.registryValue( 'quietMessage', channel=channel) log.info(