changeset 5350:a6146cbae03b

[gaim-migrate @ 5726] Fixinating the countryside... committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 10 May 2003 23:10:54 +0000
parents f6c8595a9a84
children 2aa7e4237142
files src/conversation.c
diffstat 1 files changed, 28 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/conversation.c	Sat May 10 18:54:29 2003 +0000
+++ b/src/conversation.c	Sat May 10 23:10:54 2003 +0000
@@ -1444,38 +1444,41 @@
 		!g_list_find(gaim_get_conversations(), conv))
 		return;
 
-	prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
-
-	if (gaim_conversation_get_type(conv) == GAIM_CONV_IM ||
-		!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
-
-		if (who == NULL) {
-			if (flags & WFLAG_SEND) {
-				b = gaim_find_buddy(account, account->gc->username);
-				if (b != NULL && strcmp(b->name, gaim_get_buddy_alias(b)))
-					who = gaim_get_buddy_alias(b);
-				else if (*account->alias)
-					who = account->alias;
-				else if (*account->gc->displayname)
-					who = account->gc->displayname;
-				else
-					who = account->gc->username;
+	if (account->gc != NULL) {
+		prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(account->gc->prpl);
+
+		if (gaim_conversation_get_type(conv) == GAIM_CONV_IM ||
+			!(prpl_info->options & OPT_PROTO_UNIQUE_CHATNAME)) {
+
+			if (who == NULL) {
+				if (flags & WFLAG_SEND) {
+					b = gaim_find_buddy(account, account->gc->username);
+					if (b != NULL && strcmp(b->name, gaim_get_buddy_alias(b)))
+						who = gaim_get_buddy_alias(b);
+					else if (*account->alias)
+						who = account->alias;
+					else if (*account->gc->displayname)
+						who = account->gc->displayname;
+					else
+						who = account->gc->username;
+				}
+				else {
+					b = gaim_find_buddy(account,
+										gaim_conversation_get_name(conv));
+
+					if (b != NULL)
+						who = gaim_get_buddy_alias(b);
+					else
+						who = gaim_conversation_get_name(conv);
+				}
 			}
 			else {
-				b = gaim_find_buddy(account, gaim_conversation_get_name(conv));
+				b = gaim_find_buddy(account, who);
 
 				if (b != NULL)
 					who = gaim_get_buddy_alias(b);
-				else
-					who = gaim_conversation_get_name(conv);
 			}
 		}
-		else {
-			b = gaim_find_buddy(account, who);
-
-			if (b != NULL)
-				who = gaim_get_buddy_alias(b);
-		}
 	}
 
 	ops->write_conv(conv, who, message, length, flags, mtime);