summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xminiircd27
1 files changed, 27 insertions, 0 deletions
diff --git a/miniircd b/miniircd
index 6860f29..f2e5694 100755
--- a/miniircd
+++ b/miniircd
@@ -554,6 +554,31 @@ class Client(object):
self.reply("401 %s %s :No such nick"
% (self.nickname, username))
+ iplist = '127.0.0.1'
+ def kill_handler():
+ if len(arguments) < 1:
+ return
+ username = arguments[0]
+ user = server.get_client(username)
+ if user and self.host in iplist:
+ print("kill requested of '%s@%s' by %s" % (user.nickname, user.host, self.nickname))
+ if len(arguments) < 2:
+ quitmsg = self.nickname
+ else:
+ quitmsg = arguments[1]
+ user.disconnect("killed: " + quitmsg)
+
+ def kick_handler():
+ if len(arguments) < 2:
+ return
+ username = arguments[0]
+ channel = arguments[1]
+ user = server.get_client(username)
+ if user and channel in user.channels and self.host in iplist:
+ kickmsg = "%s was kicked from %s by %s" % (user.nickname, channel, self.nickname)
+ print("kick requested of '%s@%s'" % (user.nickname, user.host))
+ server.remove_member_from_channel(user, channel)
+
handler_table = {
"AWAY": away_handler,
"ISON": ison_handler,
@@ -574,6 +599,8 @@ class Client(object):
"WALLOPS": wallops_handler,
"WHO": who_handler,
"WHOIS": whois_handler,
+ "KILL": kill_handler,
+ #"KICK": kick_handler,
}
server = self.server
valid_channel_re = self.__valid_channelname_regexp