mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-14 14:49:21 +01:00
callbacks, Misc, Relay: Fix when the message prefix is just a nick
<user> and <host> are optional in https://datatracker.ietf.org/doc/html/rfc1459#section-2.3.1 Closes GH-1451.
This commit is contained in:
parent
e59e0f6908
commit
c3f39fc93b
@ -381,7 +381,10 @@ class Misc(callbacks.Plugin):
|
||||
If <nick> is given, it takes the continuation of the last command from
|
||||
<nick> instead of the person sending this message.
|
||||
"""
|
||||
userHostmask = msg.prefix.split('!', 1)[1]
|
||||
if '!' in msg.prefix and '@' in msg.prefix:
|
||||
userHostmask = msg.prefix.split('!', 1)[1]
|
||||
else:
|
||||
userHostmask = msg.nick
|
||||
if nick:
|
||||
try:
|
||||
(private, L) = irc._mores[nick]
|
||||
|
@ -341,7 +341,7 @@ class Relay(callbacks.Plugin):
|
||||
if channel not in self.registryValue('channels'):
|
||||
return
|
||||
network = self._getIrcName(irc)
|
||||
if self.registryValue('hostmasks', channel):
|
||||
if self.registryValue('hostmasks', channel) and '!' in msg.prefix:
|
||||
hostmask = format(' (%s)', msg.prefix.split('!')[1])
|
||||
else:
|
||||
hostmask = ''
|
||||
@ -355,7 +355,7 @@ class Relay(callbacks.Plugin):
|
||||
if channel not in self.registryValue('channels'):
|
||||
return
|
||||
network = self._getIrcName(irc)
|
||||
if self.registryValue('hostmasks', channel):
|
||||
if self.registryValue('hostmasks', channel) and '!' in msg.prefix:
|
||||
hostmask = format(' (%s)', msg.prefix.split('!')[1])
|
||||
else:
|
||||
hostmask = ''
|
||||
|
@ -883,8 +883,9 @@ class ReplyIrcProxy(RichReplyMethods):
|
||||
prefix = state.nickToHostmask(target)
|
||||
except KeyError:
|
||||
pass # We'll leave it as it is.
|
||||
mask = prefix.split('!', 1)[1]
|
||||
self._mores[mask] = msgs
|
||||
if '!' in prefix and '@' in prefix:
|
||||
mask = prefix.split('!', 1)[1]
|
||||
self._mores[mask] = msgs
|
||||
public = bool(self.msg.channel)
|
||||
private = kwargs.get('private', False) or not public
|
||||
self._mores[msg.nick] = (private, msgs)
|
||||
|
Loading…
Reference in New Issue
Block a user