[svn-commits] trunk r32675 - in /trunk: include/asterisk/jabber.h res/res_jabber.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Tue Jun 6 12:51:27 MST 2006


Author: mogorman
Date: Tue Jun  6 14:51:26 2006
New Revision: 32675

URL: http://svn.digium.com/view/asterisk?rev=32675&view=rev
Log:
fixes some issues with description loggin on presence
as well as some typos.

Modified:
    trunk/include/asterisk/jabber.h
    trunk/res/res_jabber.c

Modified: trunk/include/asterisk/jabber.h
URL: http://svn.digium.com/view/asterisk/trunk/include/asterisk/jabber.h?rev=32675&r1=32674&r2=32675&view=diff
==============================================================================
--- trunk/include/asterisk/jabber.h (original)
+++ trunk/include/asterisk/jabber.h Tue Jun  6 14:51:26 2006
@@ -23,7 +23,7 @@
 #include "asterisk/astobj.h"
 
 enum aji_state {
-	AJI_DISCONNECTED=0,
+	AJI_DISCONNECTED = 0,
 	AJI_CONNECTING,
 	AJI_CONNECTED
 };
@@ -60,7 +60,7 @@
 struct aji_resource {
 	int status;
 	char resource[80];
-	char description[1000];
+	char *description;
 	struct aji_version *cap;
 	int priority;
 	struct aji_resource *next;

Modified: trunk/res/res_jabber.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_jabber.c?rev=32675&r1=32674&r2=32675&view=diff
==============================================================================
--- trunk/res/res_jabber.c (original)
+++ trunk/res/res_jabber.c Tue Jun  6 14:51:26 2006
@@ -104,7 +104,7 @@
 
 static char test_usage[] = 
 "Usage: JABBER test [client]\n" 
-"       Sends test massage for debugging purposes.  A specific client\n"
+"       Sends test message for debugging purposes.  A specific client\n"
 "       as configured in jabber.conf can be optionally specified.\n";
 
 static struct ast_cli_entry aji_cli[] = {
@@ -169,6 +169,7 @@
 
 	while ((tmp = obj->resources)) {
 		obj->resources = obj->resources->next;
+		free(tmp->description);
 		free(tmp);
 	}
 
@@ -1015,7 +1016,7 @@
 	int status, priority;
 	struct aji_buddy *buddy = NULL;
 	struct aji_resource *tmp = NULL, *last = NULL, *found = NULL;
-	char *ver, *node;
+	char *ver, *node, *descrip;
 	
 	if(client->state != AJI_CONNECTED) {
 		buddy = (struct aji_buddy *) malloc(sizeof(struct aji_buddy));
@@ -1048,10 +1049,13 @@
 	status = (pak->show) ? pak->show : 6;
 	priority = atoi((iks_find_cdata(pak->x, "priority")) ? iks_find_cdata(pak->x, "priority") : "0");
 	tmp = buddy->resources;
+	descrip = ast_strdup(iks_find_cdata(pak->x,"status"));
 
 	while (tmp) {
 		if (!strcasecmp(tmp->resource, pak->from->resource)) {
 			tmp->status = status;
+			if (tmp->description) free(tmp->description);
+			tmp->description = descrip;
 			found = tmp;
 			if (status == 6) {	/* Sign off Destroy resource */
 				if (last && found->next) {
@@ -1114,6 +1118,7 @@
 		}
 		ast_copy_string(found->resource, pak->from->resource, sizeof(found->resource));
 		found->status = status;
+		found->description = descrip;
 		found->priority = priority;
 		found->next = NULL;
 		last = NULL;



More information about the svn-commits mailing list