summaryrefslogtreecommitdiffstats
path: root/quotepass.tcl
diff options
context:
space:
mode:
authorStefan Ritter <xeno@thehappy.de>2011-08-16 10:51:41 +0200
committerStefan Ritter <xeno@thehappy.de>2011-08-16 10:51:41 +0200
commitba46c304bdffdce0b6019a47f6759ce6abbeef90 (patch)
tree40a5b204637cb65c5bb91bd4f26a248ea498e019 /quotepass.tcl
Initial commit
Diffstat (limited to 'quotepass.tcl')
-rw-r--r--quotepass.tcl41
1 files changed, 41 insertions, 0 deletions
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 <numbers>' 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
+}
+