diff libpurple/protocols/oscar/oscar.c @ 31760:eec7f176e21d

Fix crash selecting Tools->Set Mood when you're online with an ICQ account that is configured as an AIM account. (fixes #14437)
author Mark Doliner <mark@kingant.net>
date Tue, 26 Jul 2011 06:32:35 +0000
parents 2f74d4c0e63a
children a48d58e0512b 142429bcb4c8
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Tue Jul 26 06:22:43 2011 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Tue Jul 26 06:32:35 2011 +0000
@@ -743,11 +743,15 @@
 	gc->flags |= PURPLE_CONNECTION_HTML;
 	if (oscar_util_valid_name_icq((purple_account_get_username(account)))) {
 		od->icq = TRUE;
-		gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS;
 	} else {
 		gc->flags |= PURPLE_CONNECTION_AUTO_RESP;
 	}
 
+	/* Set this flag based on the protocol_id rather than the username,
+	   because that is what's tied to the get_moods prpl callback. */
+	if (g_str_equal(purple_account_get_protocol_id(account), "prpl-icq"))
+		gc->flags |= PURPLE_CONNECTION_SUPPORT_MOODS;
+
 	od->default_port = purple_account_get_int(account, "port", OSCAR_DEFAULT_LOGIN_PORT);
 
 	encryption_type = purple_account_get_string(account, "encryption", OSCAR_DEFAULT_ENCRYPTION);