RelayNext: Fix error when receiving PMs (#113)

2bd13fa0680572c0940ab249d2aa693453aa1787 replaced `msg.args[0]` with
`msg.channel`, but the latter is `None` on PMs.

Additionally, `irc.state.channels.__contains__` performs normalization
itself (and using RFC1459 normalization rather than Unicode),
so it is not needed to
normalize this early.
This commit is contained in:
Val Lorentz 2023-12-17 19:54:40 +01:00 committed by GitHub
parent 36b1789d45
commit ad7704c49f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -292,10 +292,10 @@ class RelayNext(callbacks.Plugin):
return True
def relay(self, irc, msg, channel, isAnnouncement=False):
channel = channel.lower()
self.log.debug("RelayNext (%s): got channel %s", irc.network, channel)
if not channel in irc.state.channels:
return
channel = channel.lower()
# Check for ignored events first. Checking for "'.' not in msg.nick" is for skipping
# ignore checks from servers.