[asterisk-commits] snuffy: branch snuffy/ao2_jabber_take2 r173864 - in /team/snuffy/ao2_jabber_t...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Feb 6 05:16:20 CST 2009


Author: snuffy
Date: Fri Feb  6 05:16:20 2009
New Revision: 173864

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=173864
Log:
Fix few little things

Modified:
    team/snuffy/ao2_jabber_take2/channels/chan_gtalk.c
    team/snuffy/ao2_jabber_take2/res/res_jabber.c

Modified: team/snuffy/ao2_jabber_take2/channels/chan_gtalk.c
URL: http://svn.digium.com/svn-view/asterisk/team/snuffy/ao2_jabber_take2/channels/chan_gtalk.c?view=diff&rev=173864&r1=173863&r2=173864
==============================================================================
--- team/snuffy/ao2_jabber_take2/channels/chan_gtalk.c (original)
+++ team/snuffy/ao2_jabber_take2/channels/chan_gtalk.c Fri Feb  6 05:16:20 2009
@@ -232,7 +232,6 @@
 
 static void gtalk_member_destroy(struct gtalk *obj)
 {
-	//ao2_t_ref(obj->connection->buddies, -1, "die ref");
 	obj->connection ? ao2_t_ref(obj->connection, -1, "die client ref") : 0;
 	obj->buddy ? ao2_t_ref(obj->buddy, -1, "die buddy ref") : 0;
 	ast_free(obj);

Modified: team/snuffy/ao2_jabber_take2/res/res_jabber.c
URL: http://svn.digium.com/svn-view/asterisk/team/snuffy/ao2_jabber_take2/res/res_jabber.c?view=diff&rev=173864&r1=173863&r2=173864
==============================================================================
--- team/snuffy/ao2_jabber_take2/res/res_jabber.c (original)
+++ team/snuffy/ao2_jabber_take2/res/res_jabber.c Fri Feb  6 05:16:20 2009
@@ -600,7 +600,6 @@
 
 	AST_NONSTANDARD_APP_ARGS(jid, args.jid, '/');
 
-/* I NEED A FUNCTION */
 	if (!(client = ast_aji_get_client(args.sender))) {
 		ast_log(LOG_WARNING, "Could not find sender connection: '%s'\n", args.sender);
 		return -1;
@@ -617,18 +616,20 @@
 
 	r = aji_find_resource(buddy, jid.resource);
 
-	if (!r && buddy->resources)
+	if (!r && buddy->resources) {
 		r = buddy->resources;
-	if (!r)
+	}
+	if (!r) {
 		ast_log(LOG_NOTICE, "Resource '%s' of buddy '%s' was not found\n", jid.resource, jid.screenname);
-	else
+	} else {
 		stat = r->status;
+	}
 
 	buddy_unref(buddy,"stat_exec");
 	client_unref(client, "unref client");
-/* END I NEED A FUNCTION */
 	snprintf(status, sizeof(status), "%d", stat);
 	pbx_builtin_setvar_helper(chan, args.variable, status);
+
 	return 0;
 }
 
@@ -661,29 +662,36 @@
 
 	AST_NONSTANDARD_APP_ARGS(jid, args.jid, '/');
 
-/* I NEED A FUNCTION */
 	if (!(client = ast_aji_get_client(args.sender))) {
 		ast_log(LOG_WARNING, "Could not find sender connection: '%s'\n", args.sender);
 		return -1;
 	}
+
 	ast_copy_string(tmp_buddy.name, jid.screenname, sizeof(tmp_buddy.name));
 	buddy = ao2_t_find(client->buddies, &tmp_buddy, OBJ_POINTER, "Find buddy");
+
 	if (!buddy) {
 		ast_log(LOG_WARNING, "Could not find buddy in list: '%s'\n", jid.screenname);
 		client_unref(client, "unref client");
 		return -1;
 	}
+
 	r = aji_find_resource(buddy, jid.resource);
-	if (!r && buddy->resources)
+	
+	if (!r && buddy->resources) {
 		r = buddy->resources;
-	if (!r)
+	}
+
+	if (!r) {
 		ast_log(LOG_NOTICE, "Resource %s of buddy %s was not found.\n", jid.resource, jid.screenname);
-	else
+	} else {
 		stat = r->status;
+	}
+
 	buddy_unref(buddy,"stat_read");
 	client_unref(client, "unref client");
-/* END I NEED A FUNCTION */
 	snprintf(buf, buflen, "%d", stat);
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list