]> git.sven.stormbind.net Git - sven/scripts.git/blob - xchat/myichatstrip.tcl
Import myichatstrip.tcl
[sven/scripts.git] / xchat / myichatstrip.tcl
1 #Simple script to remove the html crap sent from iChat Users
2 #I use http://www.bitlbee.org to gate my IM contacts into X-Chat
3 #written by Sven Hoexter <sven@timegate.de>
4 #Version: 0.3  2005-06-06
5
6 ### Changelog
7 # v 0.3
8 # - If a query is not yet open we have to open one first   
9 #
10 #
11 # v 0.2
12 # - fix some context missunderstanding
13 # - remove a "}" accidently left over
14 #
15 #
16 # v 0.1 - initial release
17 #
18
19 on PRIVMSG myichatstrip {
20     if { [string match -nocase "*<html>*" $_rest] } {
21         splitsrc
22         #only for debug prupose if something gets lost
23         #print "$_raw"
24         regsub -all "(<html><body.*\"><font face.*\">|</.*>)" $_rest "" outtext
25         if { [string match "[me]" $_dest] } {
26             #catch the case where a query is not yet open
27             if { [catch {findcontext $_nick}] } {
28                 command "query $_nick"
29             }
30             set context [findcontext $_nick]
31         } else {
32                 set context [getcontext]
33         }
34         print $context "-<$_nick>- \t$outtext"
35         complete EAT_XCHAT
36     }
37     complete
38 }
39
40