pidgin: fade006b: Only pre-create a PurpleConversation (if...

malu at pidgin.im malu at pidgin.im
Fri Apr 17 17:36:05 EDT 2009


-----------------------------------------------------------------
Revision: fade006b4836b4f79bfcbf8d5be330408eda6273
Ancestor: dbc659d14f747e96e7c2a3a664e4a9cee3de8a56
Author: malu at pidgin.im
Date: 2009-04-17T21:29:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/fade006b4836b4f79bfcbf8d5be330408eda6273

Modified files:
        libpurple/protocols/jabber/message.c

ChangeLog: 

Only pre-create a PurpleConversation (if there was none yet) if an incoming
message contains custom smileys.
Partly fixes the "popup a conversation window when set to hide" bug.
Until I found a better way to fix entirely...
Refs #7380

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/message.c	98719f68430c637c6f5495f1637c3e843ec46736
+++ libpurple/protocols/jabber/message.c	fb024f59b1640c23a575f1f234ed89940c010cc1
@@ -626,24 +626,27 @@ void jabber_message_parse(JabberStream *
 					purple_debug_info("jabber", "found %d smileys\n",
 						g_list_length(smiley_refs));
 
-					if (jm->type == JABBER_MESSAGE_GROUPCHAT) {
-						JabberID *jid = jabber_id_new(jm->from);
-						JabberChat *chat = NULL;
+					if (smiley_refs) {		
+						if (jm->type == JABBER_MESSAGE_GROUPCHAT) {
+							JabberID *jid = jabber_id_new(jm->from);
+							JabberChat *chat = NULL;
 
-						if (jid) {
-							chat = jabber_chat_find(js, jid->node, jid->domain);
-							if (chat) conv = chat->conv;
-						}
+							if (jid) {
+								chat = jabber_chat_find(js, jid->node, jid->domain);
+								if (chat) conv = chat->conv;
+							}
 
-						jabber_id_free(jid);
-					} else {
-						conv =
-							purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
-								who, account);
-						if (!conv) {
-							/* we need to create the conversation here */
-							conv = purple_conversation_new(PURPLE_CONV_TYPE_IM,
-								account, who);
+							jabber_id_free(jid);
+						} else {
+							conv =
+								purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY,
+									who, account);
+							if (!conv) {
+								/* we need to create the conversation here */
+								conv = 
+									purple_conversation_new(PURPLE_CONV_TYPE_IM,
+									account, who);
+							}
 						}
 					}
 
@@ -675,7 +678,7 @@ void jabber_message_parse(JabberStream *
 						    TRUE)) {
 						const JabberData *data =
 								jabber_data_find_remote_by_cid(cid);
-						/* if data is already known, we add write it immediatly */
+						/* if data is already known, we write it immediatly */
 						if (data) {
 							purple_debug_info("jabber",
 								"data is already known\n");


More information about the Commits mailing list