[asterisk-commits] phsultan: branch 1.6.0 r124871 - in /branches/1.6.0: ./ res/res_jabber.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jun 24 12:34:54 CDT 2008
Author: phsultan
Date: Tue Jun 24 12:34:53 2008
New Revision: 124871
URL: http://svn.digium.com/view/asterisk?view=rev&rev=124871
Log:
Merged revisions 124870 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r124870 | phsultan | 2008-06-24 19:28:39 +0200 (Tue, 24 Jun 2008) | 1 line
Code simplification
........
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/res/res_jabber.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/res/res_jabber.c?view=diff&rev=124871&r1=124870&r2=124871
==============================================================================
--- branches/1.6.0/res/res_jabber.c (original)
+++ branches/1.6.0/res/res_jabber.c Tue Jun 24 12:34:53 2008
@@ -2051,37 +2051,39 @@
iks *removequery = iks_new("query");
iks *removeitem = iks_new("item");
iks *send = iks_make_iq(IKS_TYPE_GET, "http://jabber.org/protocol/disco#items");
-
- if (client && removeiq && removequery && removeitem && send) {
- iks_insert_node(removeiq, removequery);
- iks_insert_node(removequery, removeitem);
- ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
- ASTOBJ_RDLOCK(iterator);
- /* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
- * be called at the same time */
- if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) {
- res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name,
- "GoodBye your status is no longer needed by Asterisk the Open Source PBX"
- " so I am no longer subscribing to your presence.\n"));
- res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBED, iterator->name,
- "GoodBye you are no longer in the asterisk config file so I am removing"
- " your access to my presence.\n"));
- iks_insert_attrib(removeiq, "from", client->jid->full);
- iks_insert_attrib(removeiq, "type", "set");
- iks_insert_attrib(removequery, "xmlns", "jabber:iq:roster");
- iks_insert_attrib(removeitem, "jid", iterator->name);
- iks_insert_attrib(removeitem, "subscription", "remove");
- res = ast_aji_send(client, removeiq);
- } else if (ast_test_flag(&iterator->flags, AJI_AUTOREGISTER)) {
- res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_SUBSCRIBE, iterator->name,
- "Greetings I am the Asterisk Open Source PBX and I want to subscribe to your presence\n"));
- ast_clear_flag(&iterator->flags, AJI_AUTOREGISTER);
- }
- ASTOBJ_UNLOCK(iterator);
- });
- } else
+ if (!client || !removeiq || !removequery || !removeitem || !send) {
ast_log(LOG_ERROR, "Out of memory.\n");
-
+ goto safeout;
+ }
+
+ iks_insert_node(removeiq, removequery);
+ iks_insert_node(removequery, removeitem);
+ ASTOBJ_CONTAINER_TRAVERSE(&client->buddies, 1, {
+ ASTOBJ_RDLOCK(iterator);
+ /* For an aji_buddy, both AUTOPRUNE and AUTOREGISTER will never
+ * be called at the same time */
+ if (ast_test_flag(&iterator->flags, AJI_AUTOPRUNE)) {
+ res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBE, iterator->name,
+ "GoodBye your status is no longer needed by Asterisk the Open Source PBX"
+ " so I am no longer subscribing to your presence.\n"));
+ res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_UNSUBSCRIBED, iterator->name,
+ "GoodBye you are no longer in the asterisk config file so I am removing"
+ " your access to my presence.\n"));
+ iks_insert_attrib(removeiq, "from", client->jid->full);
+ iks_insert_attrib(removeiq, "type", "set");
+ iks_insert_attrib(removequery, "xmlns", "jabber:iq:roster");
+ iks_insert_attrib(removeitem, "jid", iterator->name);
+ iks_insert_attrib(removeitem, "subscription", "remove");
+ res = ast_aji_send(client, removeiq);
+ } else if (ast_test_flag(&iterator->flags, AJI_AUTOREGISTER)) {
+ res = ast_aji_send(client, iks_make_s10n(IKS_TYPE_SUBSCRIBE, iterator->name,
+ "Greetings I am the Asterisk Open Source PBX and I want to subscribe to your presence\n"));
+ ast_clear_flag(&iterator->flags, AJI_AUTOREGISTER);
+ }
+ ASTOBJ_UNLOCK(iterator);
+ });
+
+ safeout:
iks_delete(removeiq);
iks_delete(removequery);
iks_delete(removeitem);
More information about the asterisk-commits
mailing list