[Freeswitch-svn] [commit] r3129 - in freeswitch/trunk/libs/libdingaling: . src

Freeswitch SVN anthm at freeswitch.org
Fri Oct 20 20:59:52 EDT 2006


Author: anthm
Date: Fri Oct 20 20:59:51 2006
New Revision: 3129

Modified:
   freeswitch/trunk/libs/libdingaling/.update
   freeswitch/trunk/libs/libdingaling/src/libdingaling.c

Log:
strip html till we figure it out

Modified: freeswitch/trunk/libs/libdingaling/.update
==============================================================================
--- freeswitch/trunk/libs/libdingaling/.update	(original)
+++ freeswitch/trunk/libs/libdingaling/.update	Fri Oct 20 20:59:51 2006
@@ -1 +1 @@
-Fri Oct 20 02:34:55 CDT 2006
+Fri Oct 20 19:58:38 CDT 2006

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c	Fri Oct 20 20:59:51 2006
@@ -1574,11 +1574,37 @@
 void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subject, char *body)
 {
 	iks *msg;
-
+	char *t, *e;
+	char *bdup = NULL;
+	int on = 0;
+	int len = 0;
 	assert(handle != NULL);
 	assert(body != NULL);
+	
+	if (strchr(body, '<')) {
+		len = (int) strlen(body);
+		if (!(bdup = malloc(len))) {
+			return;
+		}
 
-
+		memset(bdup, 0, len);
+		
+		e = bdup;
+		for(t = body; *t; t++) {
+			if (*t == '<') {
+				on = 1;
+			} else if (*t == '>') {
+				t++;
+				on = 0;
+			}
+			
+			if (!on) {
+				*e++ = *t;
+			}
+		}
+		body = bdup;
+	}
+	
 	msg = iks_make_msg(IKS_TYPE_NONE, to, body);
 	iks_insert_attrib(msg, "type", "chat");
 
@@ -1590,6 +1616,10 @@
 
 	if (subject) {
 		iks_insert_attrib(msg, "subject", subject);
+	}
+
+	if (bdup) {	
+		free(bdup);
 	}
 
 	apr_queue_push(handle->queue, msg);



More information about the Freeswitch-svn mailing list