[Freeswitch-svn] [commit] r10745 - freeswitch/trunk/src/mod/endpoints/mod_dingaling

FreeSWITCH SVN anthm at freeswitch.org
Fri Dec 12 15:07:21 PST 2008


Author: anthm
Date: Fri Dec 12 18:07:20 2008
New Revision: 10745

Log:
fix presence on jabber to be less ambiguous

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c

Modified: freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_dingaling/mod_dingaling.c	Fri Dec 12 18:07:20 2008
@@ -413,6 +413,7 @@
 	char *rpid = switch_event_get_header(event, "rpid");
 	char *type = switch_event_get_header(event, "event_subtype");
 	char *sql;
+	char pstr[128] = "";
 
 	if (globals.running != 1) {
 		return;
@@ -475,10 +476,12 @@
 		status = "Away";
 	}
 
+	if (proto) {
+		switch_snprintf(pstr, sizeof(pstr), "%s+", proto);
+	}
 
 	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)) {
 		switch_hash_this(hi, NULL, NULL, &val);



More information about the Freeswitch-svn mailing list