提交 4770a54d authored 作者: Anthony Minessale's avatar Anthony Minessale

strip html till we figure it out

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3129 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 a67dc0aa
Fri Oct 20 02:34:55 CDT 2006
Fri Oct 20 19:58:38 CDT 2006
......@@ -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);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论