pidgin: f4db276c: When you try to execute a command (e.g.,...

sadrul at pidgin.im sadrul at pidgin.im
Sun Apr 13 13:41:21 EDT 2008


-----------------------------------------------------------------
Revision: f4db276cfc4aa620ee646890091dc04329d8030b
Ancestor: b842f41e3866c11d89406467665d9f79235bf633
Author: sadrul at pidgin.im
Date: 2008-04-13T17:12:05
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f4db276cfc4aa620ee646890091dc04329d8030b

Modified files:
        libpurple/conversation.c pidgin/gtkconv.c

ChangeLog: 

When you try to execute a command (e.g., /part etc.) in a chat on a
disconnected account, the command fails. But there's no notification of the
failure. Fix this by making sure the error message gets written in the conv.

-------------- next part --------------
============================================================
--- libpurple/conversation.c	91daa642a7b1b219f3549cd1ca7a61dec598baf2
+++ libpurple/conversation.c	17b8b84a715854e1cab3ba81023f83cbebcc4399
@@ -862,7 +862,7 @@ purple_conversation_write(PurpleConversa
 		gc = purple_account_get_connection(account);
 
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT &&
-		(gc == NULL || !g_slist_find(gc->buddy_chats, conv)))
+		(gc != NULL && !g_slist_find(gc->buddy_chats, conv)))
 		return;
 
 	if (purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_IM &&
============================================================
--- pidgin/gtkconv.c	9965c96e3759111943b63e426e8a50070afd2ff0
+++ pidgin/gtkconv.c	9ae3588d3620fe56e866651332b22843eab1694a
@@ -5430,7 +5430,7 @@ pidgin_conv_write_conv(PurpleConversatio
 	account = purple_conversation_get_account(conv);
 	g_return_if_fail(account != NULL);
 	gc = purple_account_get_connection(account);
-	g_return_if_fail(gc != NULL);
+	g_return_if_fail(gc != NULL || !(flags & (PURPLE_MESSAGE_SEND | PURPLE_MESSAGE_RECV)));
 
 	/* Make sure URLs are clickable */
 	if(flags & PURPLE_MESSAGE_NO_LINKIFY)
@@ -5463,7 +5463,7 @@ pidgin_conv_write_conv(PurpleConversatio
 	}
 
 	win = gtkconv->win;
-	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+	prpl_info = gc ? PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl) : NULL;
 
 	line_count = gtk_text_buffer_get_line_count(
 			gtk_text_view_get_buffer(GTK_TEXT_VIEW(
@@ -5702,7 +5702,7 @@ pidgin_conv_write_conv(PurpleConversatio
 		g_free(alias_escaped);
 
 		/* Are we in a chat where we can tell which users are buddies? */
-		if  (!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME) &&
+		if  (prpl_info && !(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME) &&
 		     purple_conversation_get_type(conv) == PURPLE_CONV_TYPE_CHAT) {
 
 			/* Bold buddies to make them stand out from non-buddies. */


More information about the Commits mailing list