From 5a71d9c5b14aa749b532666b71b25ce2afcdc5bb Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Sat, 9 Feb 2008 18:58:13 +0100 Subject: - 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 and tags in html messages - record max message size in prpl - add 'encrypted' flag to user_t - cosmetics --- lib/misc.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'lib/misc.c') diff --git a/lib/misc.c b/lib/misc.c index 18d98f9e..a8df2354 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -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 ++; } -- cgit v1.2.3 From a161d33779bb56fabe6466f15a8ae98881f55520 Mon Sep 17 00:00:00 2001 From: Sven Moritz Hallberg Date: Thu, 14 Feb 2008 19:43:47 +0100 Subject: interpret ' --- lib/misc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/misc.c') diff --git a/lib/misc.c b/lib/misc.c index a8df2354..ccb04d4c 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -111,6 +111,7 @@ static const htmlentity_t ent[] = { "lt", "<" }, { "gt", ">" }, { "amp", "&" }, + { "apos", "'" }, { "quot", "\"" }, { "aacute", "á" }, { "eacute", "é" }, -- cgit v1.2.3