mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-22 18:39:31 +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
|
If <nick> is given, it takes the continuation of the last command from
|
||||||
<nick> instead of the person sending this message.
|
<nick> instead of the person sending this message.
|
||||||
"""
|
"""
|
||||||
|
if '!' in msg.prefix and '@' in msg.prefix:
|
||||||
userHostmask = msg.prefix.split('!', 1)[1]
|
userHostmask = msg.prefix.split('!', 1)[1]
|
||||||
|
else:
|
||||||
|
userHostmask = msg.nick
|
||||||
if nick:
|
if nick:
|
||||||
try:
|
try:
|
||||||
(private, L) = irc._mores[nick]
|
(private, L) = irc._mores[nick]
|
||||||
|
@ -341,7 +341,7 @@ class Relay(callbacks.Plugin):
|
|||||||
if channel not in self.registryValue('channels'):
|
if channel not in self.registryValue('channels'):
|
||||||
return
|
return
|
||||||
network = self._getIrcName(irc)
|
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])
|
hostmask = format(' (%s)', msg.prefix.split('!')[1])
|
||||||
else:
|
else:
|
||||||
hostmask = ''
|
hostmask = ''
|
||||||
@ -355,7 +355,7 @@ class Relay(callbacks.Plugin):
|
|||||||
if channel not in self.registryValue('channels'):
|
if channel not in self.registryValue('channels'):
|
||||||
return
|
return
|
||||||
network = self._getIrcName(irc)
|
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])
|
hostmask = format(' (%s)', msg.prefix.split('!')[1])
|
||||||
else:
|
else:
|
||||||
hostmask = ''
|
hostmask = ''
|
||||||
|
@ -883,6 +883,7 @@ class ReplyIrcProxy(RichReplyMethods):
|
|||||||
prefix = state.nickToHostmask(target)
|
prefix = state.nickToHostmask(target)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass # We'll leave it as it is.
|
pass # We'll leave it as it is.
|
||||||
|
if '!' in prefix and '@' in prefix:
|
||||||
mask = prefix.split('!', 1)[1]
|
mask = prefix.split('!', 1)[1]
|
||||||
self._mores[mask] = msgs
|
self._mores[mask] = msgs
|
||||||
public = bool(self.msg.channel)
|
public = bool(self.msg.channel)
|
||||||
|
Loading…
Reference in New Issue
Block a user