Mercurial > pidgin.yaz
changeset 29453:89f072f356ef
jabber: --header_contents;
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Mon, 15 Feb 2010 06:39:09 +0000 |
parents | 86204988c522 |
children | 5c9c4557fec2 |
files | libpurple/protocols/jabber/buddy.c libpurple/protocols/jabber/buddy.h |
diffstat | 2 files changed, 30 insertions(+), 29 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c Mon Feb 15 06:07:53 2010 +0000 +++ b/libpurple/protocols/jabber/buddy.c Mon Feb 15 06:39:09 2010 +0000 @@ -57,6 +57,36 @@ gchar *last_message; } JabberBuddyInfo; +static void +jabber_buddy_resource_free(JabberBuddyResource *jbr) +{ + g_return_if_fail(jbr != NULL); + + jbr->jb->resources = g_list_remove(jbr->jb->resources, jbr); + + while(jbr->commands) { + JabberAdHocCommands *cmd = jbr->commands->data; + g_free(cmd->jid); + g_free(cmd->node); + g_free(cmd->name); + g_free(cmd); + jbr->commands = g_list_delete_link(jbr->commands, jbr->commands); + } + + while (jbr->caps.exts) { + g_free(jbr->caps.exts->data); + jbr->caps.exts = g_list_delete_link(jbr->caps.exts, jbr->caps.exts); + } + + g_free(jbr->name); + g_free(jbr->status); + g_free(jbr->thread_id); + g_free(jbr->client.name); + g_free(jbr->client.version); + g_free(jbr->client.os); + g_free(jbr); +} + void jabber_buddy_free(JabberBuddy *jb) { g_return_if_fail(jb != NULL); @@ -219,34 +249,6 @@ return jbr; } -void jabber_buddy_resource_free(JabberBuddyResource *jbr) -{ - g_return_if_fail(jbr != NULL); - - jbr->jb->resources = g_list_remove(jbr->jb->resources, jbr); - - while(jbr->commands) { - JabberAdHocCommands *cmd = jbr->commands->data; - g_free(cmd->jid); - g_free(cmd->node); - g_free(cmd->name); - g_free(cmd); - jbr->commands = g_list_delete_link(jbr->commands, jbr->commands); - } - - if (jbr->caps.exts) { - g_list_foreach(jbr->caps.exts, (GFunc)g_free, NULL); - g_list_free(jbr->caps.exts); - } - g_free(jbr->name); - g_free(jbr->status); - g_free(jbr->thread_id); - g_free(jbr->client.name); - g_free(jbr->client.version); - g_free(jbr->client.os); - g_free(jbr); -} - void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource) { JabberBuddyResource *jbr = jabber_buddy_find_resource(jb, resource);
--- a/libpurple/protocols/jabber/buddy.h Mon Feb 15 06:07:53 2010 +0000 +++ b/libpurple/protocols/jabber/buddy.h Mon Feb 15 06:39:09 2010 +0000 @@ -97,7 +97,6 @@ const char *resource); JabberBuddyResource *jabber_buddy_track_resource(JabberBuddy *jb, const char *resource, int priority, JabberBuddyState state, const char *status); -void jabber_buddy_resource_free(JabberBuddyResource *jbr); void jabber_buddy_remove_resource(JabberBuddy *jb, const char *resource); void jabber_buddy_get_info(PurpleConnection *gc, const char *who);