提交 3caa29f4 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix presence on jabber to be less ambiguous

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10745 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 a064847a
...@@ -413,6 +413,7 @@ static void pres_event_handler(switch_event_t *event) ...@@ -413,6 +413,7 @@ static void pres_event_handler(switch_event_t *event)
char *rpid = switch_event_get_header(event, "rpid"); char *rpid = switch_event_get_header(event, "rpid");
char *type = switch_event_get_header(event, "event_subtype"); char *type = switch_event_get_header(event, "event_subtype");
char *sql; char *sql;
char pstr[128] = "";
if (globals.running != 1) { if (globals.running != 1) {
return; return;
...@@ -475,10 +476,12 @@ static void pres_event_handler(switch_event_t *event) ...@@ -475,10 +476,12 @@ static void pres_event_handler(switch_event_t *event)
status = "Away"; status = "Away";
} }
if (proto) {
switch_snprintf(pstr, sizeof(pstr), "%s+", proto);
}
sql = sql =
switch_mprintf("select sub_from, sub_to,'%q','%q','%q','%q' from jabber_subscriptions where sub_to like '%%%q'", type, rpid, status, proto, from); switch_mprintf("select sub_from, sub_to,'%q','%q','%q','%q' from jabber_subscriptions where sub_to = '%q%q'", type, rpid, status, proto, pstr, from);
for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) { for (hi = switch_hash_first(NULL, globals.profile_hash); hi; hi = switch_hash_next(hi)) {
switch_hash_this(hi, NULL, NULL, &val); switch_hash_this(hi, NULL, NULL, &val);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论