im.pidgin.pidgin: 3d09514342c28c798103b050651727e19709c903

sadrul at pidgin.im sadrul at pidgin.im
Fri Nov 30 22:41:21 EST 2007


-----------------------------------------------------------------
Revision: 3d09514342c28c798103b050651727e19709c903
Ancestor: 08f542359200866bb7a302653d875cdeccb8df01
Author: sadrul at pidgin.im
Date: 2007-12-01T01:44:54
Branch: im.pidgin.pidgin

Modified files:
        pidgin/gtkconv.c

ChangeLog: 

disapproval of revision '08f542359200866bb7a302653d875cdeccb8df01'
-------------- next part --------------
============================================================
--- pidgin/gtkconv.c	5edb0f3a91c8d49133aa9559728d70a4f24222e3
+++ pidgin/gtkconv.c	733607ca7e550776a5f33b82d842a5a94992577f
@@ -5042,24 +5042,27 @@ received_im_msg_cb(PurpleAccount *accoun
 				   PurpleConversation *conv, PurpleMessageFlags flags)
 {
 	PurpleConversationUiOps *ui_ops = pidgin_conversations_get_conv_ui_ops();
+	if (conv != NULL)
+		return;
 
-	/* XXX sadrul: set _ui_ops for the conversation to NULL, and get rid of the hidden convwindow */
 	/* create hidden conv if hide_new pref is always */
-	/* or if hide_new pref is away and account is away */
-	if ((strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "always") == 0) ||
-		(strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away") == 0 &&
-		 !purple_status_is_available(purple_account_get_active_status(account)))) {
-		if (!conv) {
-			ui_ops->create_conversation = NULL;
-			conv = purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender);
-			purple_conversation_set_ui_ops(conv, NULL);
-			ui_ops->create_conversation = pidgin_conv_new;
-		}
-	} else {
-		/* new message for an IM */
-		if (conv && conv->type == PURPLE_CONV_TYPE_IM)
-			pidgin_conv_attach_to_conversation(conv);
+	if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "always") == 0)
+	{
+		ui_ops->create_conversation = pidgin_conv_new_hidden;
+		purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender);
+		ui_ops->create_conversation = pidgin_conv_new;
+		return;
 	}
+
+	/* create hidden conv if hide_new pref is away and account is away */
+	if (strcmp(purple_prefs_get_string(PIDGIN_PREFS_ROOT "/conversations/im/hide_new"), "away") == 0 &&
+	    !purple_status_is_available(purple_account_get_active_status(account)))
+	{
+		ui_ops->create_conversation = pidgin_conv_new_hidden;
+		purple_conversation_new(PURPLE_CONV_TYPE_IM, account, sender);
+		ui_ops->create_conversation = pidgin_conv_new;
+		return;
+	}
 }
 
 static void


More information about the Commits mailing list