diff options
author | Sven Moritz Hallberg <sm@khjk.org> | 2008-02-09 18:58:13 +0100 |
---|---|---|
committer | Sven Moritz Hallberg <sm@khjk.org> | 2008-02-09 18:58:13 +0100 |
commit | 5a71d9c5b14aa749b532666b71b25ce2afcdc5bb (patch) | |
tree | 5e6ec25cb526a9940ba6ba4c63dc590a8991679f /lib/misc.c | |
parent | a13855a57daae6eba05c9600b69f640c2949e944 (diff) |
- add support for setting ops/voice according to OTR msgstate
- add 'otr trust' user command
- support non-otr messages during keygen
- run otr messages through strip_html
- interpret <b> and <i> tags in html messages
- record max message size in prpl
- add 'encrypted' flag to user_t
- cosmetics
Diffstat (limited to 'lib/misc.c')
-rw-r--r-- | lib/misc.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -142,6 +142,7 @@ void strip_html( char *in ) char *out = g_malloc( strlen( in ) + 1 ); char *s = out, *cs; int i, matched; + int taglen; memset( out, 0, strlen( in ) + 1 ); @@ -158,9 +159,18 @@ void strip_html( char *in ) while( *in && *in != '>' ) in ++; + taglen = in-cs-1; /* not <0 because the above loop runs at least once */ if( *in ) { - if( g_strncasecmp( cs+1, "br", 2) == 0 ) + if( g_strncasecmp( cs+1, "b", taglen) == 0 ) + *(s++) = '\x02'; + else if( g_strncasecmp( cs+1, "/b", taglen) == 0 ) + *(s++) = '\x02'; + else if( g_strncasecmp( cs+1, "i", taglen) == 0 ) + *(s++) = '\x1f'; + else if( g_strncasecmp( cs+1, "/i", taglen) == 0 ) + *(s++) = '\x1f'; + else if( g_strncasecmp( cs+1, "br", 2) == 0 ) *(s++) = '\n'; in ++; } |