From ba46c304bdffdce0b6019a47f6759ce6abbeef90 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Tue, 16 Aug 2011 10:51:41 +0200 Subject: Initial commit --- quotepass.tcl | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 quotepass.tcl (limited to 'quotepass.tcl') diff --git a/quotepass.tcl b/quotepass.tcl new file mode 100644 index 0000000..0e35d9c --- /dev/null +++ b/quotepass.tcl @@ -0,0 +1,41 @@ +# +# quotepass.tcl +# written by simple, [sL], and guppy +# +# Some servers on the Undernet will make you send 'PASS ' before you +# can connect if you did not return an identd response. This script will +# handle sending that for you. +# +# updates +# ------- +# 10Feb08: initial version +# +# $Id: quotepass.tcl,v 1.3 2008/02/11 02:28:41 guppy Exp $ + +set quotepass_resyntax "must type /QUOTE PASS (\[^\" \]*)" + +bind evnt - init-server quotepass_unbind +bind evnt - disconnect-server quotepass_unbind +bind evnt - connect-server quotepass_bind + +proc quotepass_notice {from cmd text} { + global quotepass_resyntax + if {[regexp -nocase $quotepass_resyntax $text - pass]} { + putlog "Got a QUOTE PASS request from the server, sending \"PASS $pass\"" + putserv "PASS $pass" + } + return 0 +} + +proc quotepass_unbind {type} { + # Try to unbind our raw NOTICE bind once we are connected since it will + # never be needed again + catch { + unbind raw - NOTICE quotepass_notice + } +} + +proc quotepass_bind {type} { + bind raw - NOTICE quotepass_notice +} + -- cgit v1.2.3