changeset 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 5b56656ff5a5
children e1f1e7b927c3
files ChangeLog libpurple/protocols/oscar/oscar.c
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Jul 26 06:22:43 2011 +0000
+++ b/ChangeLog	Tue Jul 26 06:32:35 2011 +0000
@@ -20,6 +20,10 @@
 	* Fix building of the bundled libgadu library with older versions
 	  of GnuTLS. (patch plucked from upstream) (#14365)
 
+	ICQ:
+	* Fix crash selecting Tools->Set Mood when you're online with an
+	  ICQ account that is configured as an AIM account. (#14437)
+
 	IRC:
 	* Fix the handling of formatting following mIRC ^O (#14436)
 
--- 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);