]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
strip html till we figure it out
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 21 Oct 2006 00:59:51 +0000 (00:59 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 21 Oct 2006 00:59:51 +0000 (00:59 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3129 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/libdingaling/.update
libs/libdingaling/src/libdingaling.c

index 020e6398ffb12e0dafc9bb3c4a7590ef475e0fba..2ba15fe147c5d3538c5cb9d4751eb6d5cef8c6d8 100644 (file)
@@ -1 +1 @@
-Fri Oct 20 02:34:55 CDT 2006
+Fri Oct 20 19:58:38 CDT 2006
index 3dfa4753b94a6bce849c92ff3ac27dee414a58c3..2b4746560fe94635ee452624076999dfb726c9bb 100644 (file)
@@ -1574,11 +1574,37 @@ void ldl_handle_send_presence(ldl_handle_t *handle, char *from, char *to, char *
 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");
 
@@ -1592,6 +1618,10 @@ void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subje
                iks_insert_attrib(msg, "subject", subject);
        }
 
+       if (bdup) {     
+               free(bdup);
+       }
+
        apr_queue_push(handle->queue, msg);
        
 }