Mercurial > pidgin.yaz
changeset 26031:c6c6dc6ccdc7
propagate from branch 'im.pidgin.pidgin' (head 6b8c653bfd16896dc5b445bb8147d09a37e8db4c)
to branch 'im.pidgin.maiku.vv' (head 88691d9566db1f42fa4b1ef880ea02ec3d5f9239)
author | Mike Ruprecht <maiku@soc.pidgin.im> |
---|---|
date | Fri, 07 Nov 2008 03:01:55 +0000 |
parents | dd787f8d5e91 (diff) 365eb0b68d5f (current diff) |
children | b83c83143a69 |
files | libpurple/protocols/sametime/sametime.c |
diffstat | 6 files changed, 54 insertions(+), 43 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/jabber/buddy.c Fri Nov 07 03:00:09 2008 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri Nov 07 03:01:55 2008 +0000 @@ -2510,12 +2510,13 @@ } for (iter = jbr->caps->features ; iter ; iter = g_list_next(iter)) { - purple_debug_info("jabber", "Found cap: %s\n", (char *)iter->data); if (strcmp(iter->data, cap) == 0) { + purple_debug_info("jabber", "Found cap: %s\n", (char *)iter->data); return TRUE; } } + purple_debug_info("jabber", "Cap %s not found\n", cap); return FALSE; }
--- a/libpurple/protocols/oscar/oscar.c Fri Nov 07 03:00:09 2008 +0000 +++ b/libpurple/protocols/oscar/oscar.c Fri Nov 07 03:01:55 2008 +0000 @@ -6091,10 +6091,11 @@ gc = purple_account_get_connection(buddy->account); od = gc->proto_data; - data = g_new(struct name_data, 1); - if (!(g = purple_buddy_get_group(buddy))) return; + + data = g_new(struct name_data, 1); + comment = aim_ssi_getcomment(od->ssi.local, g->name, buddy->name); comment_utf8 = comment ? oscar_utf8_try_convert(gc->account, comment) : NULL;
--- a/libpurple/protocols/sametime/sametime.c Fri Nov 07 03:00:09 2008 +0000 +++ b/libpurple/protocols/sametime/sametime.c Fri Nov 07 03:01:55 2008 +0000 @@ -4490,27 +4490,25 @@ PurpleBuddy *buddy, PurpleGroup *group) { - struct mwPurplePluginData *pd; + struct mwPurplePluginData *pd = gc->proto_data; struct mwServiceResolve *srvc; GList *query; enum mwResolveFlag flags; guint32 req; - BuddyAddData *data; - data = g_new0(BuddyAddData, 1); - data->buddy = buddy; - data->group = group; - - pd = gc->proto_data; - srvc = pd->srvc_resolve; - /* catch external buddies. They won't be in the resolve service */ if(buddy_is_external(buddy)) { buddy_add(pd, buddy); return; } + data = g_new0(BuddyAddData, 1); + data->buddy = buddy; + data->group = group; + + srvc = pd->srvc_resolve; + query = g_list_prepend(NULL, buddy->name); flags = mwResolveFlag_FIRST | mwResolveFlag_USERS;
--- a/libpurple/protocols/simple/sipmsg.c Fri Nov 07 03:00:09 2008 +0000 +++ b/libpurple/protocols/simple/sipmsg.c Fri Nov 07 03:01:55 2008 +0000 @@ -56,14 +56,17 @@ struct sipmsg *sipmsg_parse_header(const gchar *header) { struct sipmsg *msg = g_new0(struct sipmsg,1); - gchar **lines = g_strsplit(header,"\r\n",0); - gchar **parts; - gchar *dummy; - gchar *dummy2; - gchar *tmp; + gchar **parts, **lines = g_strsplit(header,"\r\n",0); + gchar *dummy, *dummy2, *tmp; const gchar *tmp2; - int i=1; - if(!lines[0]) return NULL; + int i = 1; + + if(!lines[0]) { + g_strfreev(lines); + g_free(msg); + return NULL; + } + parts = g_strsplit(lines[0], " ", 3); if(!parts[0] || !parts[1] || !parts[2]) { g_strfreev(parts); @@ -71,6 +74,7 @@ g_free(msg); return NULL; } + if(strstr(parts[0],"SIP")) { /* numeric response */ msg->method = g_strdup(parts[2]); msg->response = strtol(parts[1],NULL,10); @@ -80,6 +84,7 @@ msg->response = 0; } g_strfreev(parts); + for(i=1; lines[i] && strlen(lines[i])>2; i++) { parts = g_strsplit(lines[i], ":", 2); if(!parts[0] || !parts[1]) { @@ -104,9 +109,11 @@ g_strfreev(parts); } g_strfreev(lines); + tmp2 = sipmsg_find_header(msg, "Content-Length"); if (tmp2 != NULL) msg->bodylen = strtol(tmp2, NULL, 10); + if(msg->response) { tmp2 = sipmsg_find_header(msg, "CSeq"); if(!tmp2) { @@ -118,6 +125,7 @@ g_strfreev(parts); } } + return msg; }
--- a/pidgin/gtkimhtml.c Fri Nov 07 03:00:09 2008 +0000 +++ b/pidgin/gtkimhtml.c Fri Nov 07 03:01:55 2008 +0000 @@ -2045,29 +2045,6 @@ return 0; } -/* a hack-around to prevent trying to doing gtk_smiley_tree_remove on a - GtkIMHtml that no longer lives... I know this is ugly, but I couldn't find - a better way to handle it for now, since there lives a list GtkIMHtmlSmileys - in gtksmiley.c and those can end up having dangling imhtml pointers */ -static gboolean -gtk_imhtml_is_alive(const GtkIMHtml *imhtml) -{ - GList *convs; - - for (convs = purple_get_conversations() ; convs != NULL ; - convs = g_list_next(convs)) { - PurpleConversation *conv = (PurpleConversation *) convs->data; - - if (PIDGIN_IS_PIDGIN_CONVERSATION(conv)) { - if (GTK_IMHTML(PIDGIN_CONVERSATION(conv)->imhtml) == imhtml - || GTK_IMHTML(PIDGIN_CONVERSATION(conv)->entry) == imhtml) { - return TRUE; - } - } - } - return FALSE; -} - static void gtk_imhtml_disassociate_smiley_foreach(gpointer key, gpointer value, gpointer user_data) @@ -2078,12 +2055,22 @@ } static void +gtk_imhtml_disconnect_smiley(GtkIMHtml *imhtml, GtkIMHtmlSmiley *smiley) +{ + smiley->imhtml = NULL; + g_signal_handlers_disconnect_matched(imhtml, G_SIGNAL_MATCH_DATA, 0, 0, + NULL, NULL, smiley); +} + +static void gtk_imhtml_disassociate_smiley(GtkIMHtmlSmiley *smiley) { - if (smiley->imhtml && gtk_imhtml_is_alive(smiley->imhtml)) { + if (smiley->imhtml) { gtk_smiley_tree_remove(smiley->imhtml->default_smilies, smiley); g_hash_table_foreach(smiley->imhtml->smiley_data, gtk_imhtml_disassociate_smiley_foreach, smiley); + g_signal_handlers_disconnect_matched(smiley->imhtml, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, smiley); smiley->imhtml = NULL; } } @@ -2104,9 +2091,19 @@ g_hash_table_insert(imhtml->smiley_data, g_strdup(sml), tree); } + /* need to disconnect old imhtml, if there is one */ + if (smiley->imhtml) { + g_signal_handlers_disconnect_matched(smiley->imhtml, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, smiley); + } + smiley->imhtml = imhtml; gtk_smiley_tree_insert (tree, smiley); + + /* connect destroy signal for the imhtml */ + g_signal_connect(imhtml, "destroy", G_CALLBACK(gtk_imhtml_disconnect_smiley), + smiley); } static gboolean
--- a/pidgin/gtkthemes.c Fri Nov 07 03:00:09 2008 +0000 +++ b/pidgin/gtkthemes.c Fri Nov 07 03:01:55 2008 +0000 @@ -169,6 +169,12 @@ for (wer = theme->list; wer != NULL; wer = theme->list) { while (wer->smileys) { GtkIMHtmlSmiley *uio = wer->smileys->data; + + if (uio->imhtml) { + g_signal_handlers_disconnect_matched(uio->imhtml, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, uio); + } + if (uio->icon) g_object_unref(uio->icon); if (g_hash_table_lookup(already_freed, uio->file) == NULL) {