diff options
author | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-06 19:51:26 +0000 |
---|---|---|
committer | mogorman <mogorman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-06 19:51:26 +0000 |
commit | 3bc4a9918256e95d821e1e34a3b1ac45ea4423bf (patch) | |
tree | 2e78fa04c1ab7feeafaf7f5b7097e398c4fdb9cf /res/res_jabber.c | |
parent | ce04789775c3f638ee35637eea72e9d8584ab02b (diff) |
fixes some issues with description loggin on presence
as well as some typos.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@32675 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'res/res_jabber.c')
-rw-r--r-- | res/res_jabber.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_jabber.c b/res/res_jabber.c index 8a16ade88..a7f3fd863 100644 --- a/res/res_jabber.c +++ b/res/res_jabber.c @@ -104,7 +104,7 @@ static char reload_usage[] = 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 @@ static void aji_buddy_destroy(struct aji_buddy *obj) while ((tmp = obj->resources)) { obj->resources = obj->resources->next; + free(tmp->description); free(tmp); } @@ -1015,7 +1016,7 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak) 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 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak) 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 @@ static void aji_handle_presence(struct aji_client *client, ikspak *pak) } 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; |