pidgin: 92ad55eb: Do not create a conversation yet.

sadrul at pidgin.im sadrul at pidgin.im
Mon Sep 28 21:36:38 EDT 2009


-----------------------------------------------------------------
Revision: 92ad55eb528d0648b91b5bbb14a0ef1c8a5288fa
Ancestor: 7e3fd3697f924784c43e0ca3be6f9dde0cfdfaec
Author: sadrul at pidgin.im
Date: 2009-09-28T17:39:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/92ad55eb528d0648b91b5bbb14a0ef1c8a5288fa

Modified files:
        libpurple/protocols/yahoo/libymsg.c

ChangeLog: 

Do not create a conversation yet.

A plugin can stop a conversation from being created by intercepting the
receiving-*-msg signals. But this code would always open a conversation
if a '/buzz' is received as the first message. So we end up with an empty
conversation window that we didn't create, and it's confusing as poop!

Interestingly, I noticed this because the clang-analyzer cried about it.
So yay clang-analyzer!

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	963ad34681074c54d9169812115816c6f1aef110
+++ libpurple/protocols/yahoo/libymsg.c	a1a79930e90c8188fa7af0e23c190b87b45ce561
@@ -1025,7 +1025,6 @@ static void yahoo_process_message(Purple
 		char *m, *m2;
 		char *msn_from = NULL;
 		const char *from;
-		PurpleConversation *c;
 		im = l->data;
 
 		if (!im->from || !im->msg) {
@@ -1077,14 +1076,9 @@ static void yahoo_process_message(Purple
 			from = im->from;
 		}
 
-		c = purple_find_conversation_with_account(PURPLE_CONV_TYPE_IM, from, account);
-
 		if (!strcmp(m, "<ding>")) {
 			char *username;
 
-			if (c == NULL) {
-				c = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, from);
-			}
 			username = g_markup_escape_text(from, -1);
 			purple_prpl_got_attention(gc, username, YAHOO_BUZZ);
 			g_free(username);


More information about the Commits mailing list