3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +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:
James Lu 2016-02-25 21:11:42 -08:00
parent 393466498e
commit a7a98c9a52

View File

@ -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