mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-05 18:13:27 +00:00
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:
parent
a67dc0aab6
commit
4770a54d37
@ -1 +1 @@
|
|||||||
Fri Oct 20 02:34:55 CDT 2006
|
Fri Oct 20 19:58:38 CDT 2006
|
||||||
|
@ -1574,10 +1574,36 @@ 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)
|
void ldl_handle_send_msg(ldl_handle_t *handle, char *from, char *to, char *subject, char *body)
|
||||||
{
|
{
|
||||||
iks *msg;
|
iks *msg;
|
||||||
|
char *t, *e;
|
||||||
|
char *bdup = NULL;
|
||||||
|
int on = 0;
|
||||||
|
int len = 0;
|
||||||
assert(handle != NULL);
|
assert(handle != NULL);
|
||||||
assert(body != 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);
|
msg = iks_make_msg(IKS_TYPE_NONE, to, body);
|
||||||
iks_insert_attrib(msg, "type", "chat");
|
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);
|
iks_insert_attrib(msg, "subject", subject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (bdup) {
|
||||||
|
free(bdup);
|
||||||
|
}
|
||||||
|
|
||||||
apr_queue_push(handle->queue, msg);
|
apr_queue_push(handle->queue, msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user