changeset 30648:53469b47d3f3

Add a comment noting the moods should be sorted post-translation. Also split out a slightly-confusing use of the ? ternary operator and add a check on PURPLE_PROTOCOL_PLUGIN_HAS_FUNC. Didn't touch the mysterious crashing code from #12245.
author Paul Aurich <paul@darkrain42.org>
date Tue, 29 Jun 2010 19:22:31 +0000
parents ebc34634e592
children 6a3aaa4e5e56 fa311a0e51c0
files pidgin/gtkblist.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Tue Jun 29 17:34:21 2010 +0000
+++ b/pidgin/gtkblist.c	Tue Jun 29 19:22:31 2010 +0000
@@ -3601,11 +3601,12 @@
 		purple_request_field_list_add_selected(f, _("None"));
 
 	/* TODO: rlaager wants this sorted. */
-	/* The connection is checked for PURPLE_CONNECTION_SUPPORT_MOODS flag before
-	 * this function is called for a non-null account. So using
-	 * PURPLE_PROTOCOL_PLUGIN_HAS_FUNC isn't necessary here */
-	for (mood = account ? prpl_info->get_moods(account) : global_moods;
-	     mood->mood != NULL ; mood++) {
+	/* TODO: darkrain wants it sorted post-translation */
+	if (account && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_moods))
+		mood = prpl_info->get_moods(account);
+	else
+		mood = global_moods;
+	for ( ; mood->mood != NULL ; mood++) {
 		char *path;
 
 		if (mood->mood == NULL || mood->description == NULL)