From c1d98838d7497a9d8ddcff365934d9213f628e00 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 21 Aug 2015 00:39:58 -0700 Subject: [PATCH] plugins/admin: allow sending KICK from servers (#90) --- plugins/admin.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/admin.py b/plugins/admin.py index 57a2b3d..a834222 100644 --- a/plugins/admin.py +++ b/plugins/admin.py @@ -144,12 +144,15 @@ def kick(irc, source, args): except IndexError: utils.msg(irc, source, "Error: not enough arguments. Needs 3-4: source nick, channel, target, reason (optional).") return - u = utils.nickToUid(irc, nick) + u = utils.nickToUid(irc, nick) or nick targetu = utils.nickToUid(irc, target) if not utils.isChannel(channel): utils.msg(irc, source, "Error: Invalid channel name %r." % channel) return - irc.proto.kickClient(irc, u, channel, targetu, reason) + if utils.isInternalServer(irc, u): + irc.proto.kickServer(irc, u, channel, targetu, reason) + else: + irc.proto.kickClient(irc, u, channel, targetu, reason) irc.callHooks([u, 'PYLINK_ADMIN_KICK', {'channel': channel, 'target': targetu, 'text': reason, 'parse_as': 'KICK'}]) @utils.add_cmd