strip html till we figure it out

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3129 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2006-10-21 00:59:51 +00:00
parent a67dc0aab6
commit 4770a54d37
2 changed files with 33 additions and 3 deletions

View File

@ -1 +1 @@
Fri Oct 20 02:34:55 CDT 2006
Fri Oct 20 19:58:38 CDT 2006

View 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);
}