3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-28 05:32:51 +01:00

relay: simplify clientbot forcepart/kick formatting

This commit is contained in:
James Lu 2019-11-29 23:52:19 -08:00
parent 72c57d433a
commit b9561500fd

View File

@ -1470,7 +1470,7 @@ def handle_part(irc, numeric, command, args):
for user in irc.channels[channel].users.copy():
if (not irc.is_internal_client(user)) and (not is_relay_client(irc, user)):
irc.call_hooks([irc.sid, 'CLIENTBOT_SERVICE_KICKED', {'channel': channel, 'target': user,
'text': 'Clientbot was force parted (Reason: %s)' % text or 'None',
'text': 'Clientbot was force parted (%s)' % text or 'None',
'parse_as': 'KICK'}])
irc.join(irc.pseudoclient.uid, channel)
@ -1683,7 +1683,7 @@ def handle_kick(irc, source, command, args):
if (not irc.has_cap('can-spawn-clients')) and irc.pseudoclient and target == irc.pseudoclient.uid:
for user in irc.channels[channel].users:
if (not irc.is_internal_client(user)) and (not is_relay_client(irc, user)):
reason = "Clientbot kicked by %s (Reason: %s)" % (irc.get_friendly_name(source), text)
reason = "Clientbot kicked by %s (%s)" % (irc.get_friendly_name(source), text)
irc.call_hooks([irc.sid, 'CLIENTBOT_SERVICE_KICKED', {'channel': channel, 'target': user,
'text': reason, 'parse_as': 'KICK'}])