]> git.sven.stormbind.net Git - sven/scripts.git/commitdiff
Import myichatstrip.tcl
authorSven Hoexter <sven@timegate.de>
Mon, 17 Jan 2011 17:43:35 +0000 (18:43 +0100)
committerSven Hoexter <sven@timegate.de>
Mon, 17 Jan 2011 17:43:35 +0000 (18:43 +0100)
xchat/myichatstrip.tcl [new file with mode: 0644]

diff --git a/xchat/myichatstrip.tcl b/xchat/myichatstrip.tcl
new file mode 100644 (file)
index 0000000..15aa33e
--- /dev/null
@@ -0,0 +1,40 @@
+#Simple script to remove the html crap sent from iChat Users
+#I use http://www.bitlbee.org to gate my IM contacts into X-Chat
+#written by Sven Hoexter <sven@timegate.de>
+#Version: 0.3  2005-06-06
+
+### Changelog
+# v 0.3
+# - If a query is not yet open we have to open one first   
+#
+#
+# v 0.2
+# - fix some context missunderstanding
+# - remove a "}" accidently left over
+#
+#
+# v 0.1 - initial release
+#
+
+on PRIVMSG myichatstrip {
+    if { [string match -nocase "*<html>*" $_rest] } {
+       splitsrc
+       #only for debug prupose if something gets lost
+       #print "$_raw"
+       regsub -all "(<html><body.*\"><font face.*\">|</.*>)" $_rest "" outtext
+       if { [string match "[me]" $_dest] } {
+           #catch the case where a query is not yet open
+           if { [catch {findcontext $_nick}] } {
+               command "query $_nick"
+           }
+           set context [findcontext $_nick]
+       } else {
+               set context [getcontext]
+       }
+       print $context "-<$_nick>- \t$outtext"
+       complete EAT_XCHAT
+    }
+    complete
+}
+
+