From 620de651ce4fd642956f3c8abfa21e558adefe35 Mon Sep 17 00:00:00 2001 From: Michael Stummvoll Date: Thu, 19 Feb 2015 13:59:27 +0100 Subject: [PATCH] add ctcp version check and kick the logbot clients --- plugins/chch_worker.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/plugins/chch_worker.py b/plugins/chch_worker.py index 5ebc24f..c0a95c9 100644 --- a/plugins/chch_worker.py +++ b/plugins/chch_worker.py @@ -162,6 +162,16 @@ def topic_update(info, conn=None, chan=None): if new_topic != topic: conn.send("TOPIC %s :%s" % (chan, new_topic)) +@hook.event("JOIN") +def handle_join(info, input=None, conn=None): + conn.ctcp(input.nick, "VERSION", "") + +@hook.event("NOTICE") +def handle_ctcp_rply(info, input=None, conn=None, nick=None): + if input.lastparam == "\1%s\1" % "mIRC v7.22 Khaled Mardam-Bey": + for chan in conn.channels: + conn.send("KICK %s %s :bad version" % (chan, nick)) + @hook.event("332") def e332_update(info, conn=None, chan=None): """e332_update -- run after current topic was requested, runs worker tasks too"""