| 93 text = NULL; |
93 text = NULL; |
| 94 } |
94 } |
| 95 |
95 |
| 96 update_status_with_mood(account, mood, text); |
96 update_status_with_mood(account, mood, text); |
| 97 } else { |
97 } else { |
| 98 GList *accounts = purple_accounts_get_all_active(); |
98 PurpleAccountManager *manager = purple_account_manager_get_default(); |
| |
99 GList *accounts = purple_account_manager_get_all(manager); |
| 99 |
100 |
| 100 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
101 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
| 101 PurpleAccount *account = (PurpleAccount *) accounts->data; |
102 PurpleAccount *account = (PurpleAccount *) accounts->data; |
| 102 |
103 |
| 103 connection = purple_account_get_connection(account); |
104 connection = purple_account_get_connection(account); |
| 128 * |
129 * |
| 129 * Returns: (transfer full): A list of all global moods. |
130 * Returns: (transfer full): A list of all global moods. |
| 130 */ |
131 */ |
| 131 static PurpleMood * |
132 static PurpleMood * |
| 132 pidgin_mood_get_global_moods(void) { |
133 pidgin_mood_get_global_moods(void) { |
| |
134 PurpleAccountManager *manager = NULL; |
| 133 GHashTable *global_moods = NULL; |
135 GHashTable *global_moods = NULL; |
| 134 GHashTable *mood_counts = NULL; |
136 GHashTable *mood_counts = NULL; |
| 135 GList *accounts = NULL; |
137 GList *accounts = NULL; |
| 136 PurpleMood *result = NULL; |
138 PurpleMood *result = NULL; |
| 137 GList *out_moods = NULL; |
139 GList *out_moods = NULL; |
| 139 int num_accounts = 0; |
141 int num_accounts = 0; |
| 140 |
142 |
| 141 global_moods = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
143 global_moods = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
| 142 mood_counts = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
144 mood_counts = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, NULL); |
| 143 |
145 |
| 144 accounts = purple_accounts_get_all_active(); |
146 manager = purple_account_manager_get_default(); |
| |
147 accounts = purple_account_manager_get_active(manager); |
| 145 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
148 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
| 146 PurpleAccount *account = (PurpleAccount *) accounts->data; |
149 PurpleAccount *account = (PurpleAccount *) accounts->data; |
| 147 if (purple_account_is_connected(account)) { |
150 if (purple_account_is_connected(account)) { |
| 148 PurpleConnection *gc = purple_account_get_connection(account); |
151 PurpleConnection *gc = purple_account_get_connection(account); |
| 149 |
152 |
| 200 * Returns: The currently selected mood name or %NULL if a mood is not set, or |
203 * Returns: The currently selected mood name or %NULL if a mood is not set, or |
| 201 * accounts are using different moods. |
204 * accounts are using different moods. |
| 202 */ |
205 */ |
| 203 static const gchar * |
206 static const gchar * |
| 204 pidgin_mood_get_global_status(void) { |
207 pidgin_mood_get_global_status(void) { |
| 205 GList *accounts = purple_accounts_get_all_active(); |
208 PurpleAccountManager *manager = NULL; |
| |
209 GList *accounts = NULL; |
| 206 const gchar *found_mood = NULL; |
210 const gchar *found_mood = NULL; |
| 207 |
211 |
| |
212 manager = purple_account_manager_get_default(); |
| |
213 accounts = purple_account_manager_get_active(manager); |
| 208 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
214 for (; accounts ; accounts = g_list_delete_link(accounts, accounts)) { |
| 209 PurpleAccount *account = (PurpleAccount *) accounts->data; |
215 PurpleAccount *account = (PurpleAccount *) accounts->data; |
| 210 |
216 |
| 211 if (purple_account_is_connected(account) && |
217 if (purple_account_is_connected(account) && |
| 212 (purple_connection_get_flags(purple_account_get_connection(account)) & |
218 (purple_connection_get_flags(purple_account_get_connection(account)) & |