mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
inspircd: format kill reasons like "Killed (sourcenick (reason))"
InspIRCd will show the raw kill message sent from servers as the quit message. So, make kills look actually like a kill instead of someone quitting with an arbitrary message.
This commit is contained in:
parent
393466498e
commit
a7a98c9a52
@ -184,7 +184,15 @@ class InspIRCdProtocol(TS6BaseProtocol):
|
||||
(not self.irc.isInternalServer(numeric)):
|
||||
raise LookupError('No such PyLink client/server exists.')
|
||||
|
||||
self._send(numeric, 'KILL %s :%s' % (target, reason))
|
||||
# InspIRCd will show the raw kill message sent from our server as the quit message.
|
||||
# So, make the kill look actually like a kill instead of someone quitting with
|
||||
# an arbitrary message.
|
||||
if target in self.irc.servers:
|
||||
sourcenick = self.irc.servers[numeric].name
|
||||
else:
|
||||
sourcenick = self.irc.users[numeric].nick
|
||||
|
||||
self._send(numeric, 'KILL %s :Killed (%s (%s))' % (target, sourcenick, reason))
|
||||
|
||||
# We only need to call removeClient here if the target is one of our
|
||||
# clients, since any remote servers will send a QUIT from
|
||||
|
Loading…
Reference in New Issue
Block a user