[gaim-migrate @ 12991]

Sun, 03 Jul 2005 06:12:50 +0000

author
Sadrul Habib Chowdhury <sadrul@pidgin.im>
date
Sun, 03 Jul 2005 06:12:50 +0000
changeset 11053
6d2abb51e586
parent 11052
c24e00c4ffd7
child 11054
ba2440c5ee48

[gaim-migrate @ 12991]
Patch 1231506 from sadrul

"gaim_accounts_get_all_active functions is declared in src/account.h which should return a list of active (enabled) accounts, but it is not implemented anywhere. This patch implements the function."

This implementation looks right. It works for him. Why not?

committer: Richard Laager <rlaager@pidgin.im>

src/account.c file | annotate | diff | comparison | revisions
--- a/src/account.c	Sun Jul 03 05:28:57 2005 +0000
+++ b/src/account.c	Sun Jul 03 06:12:50 2005 +0000
@@ -24,6 +24,7 @@
  */
 #include "internal.h"
 #include "account.h"
+#include "core.h"
 #include "debug.h"
 #include "notify.h"
 #include "pounce.h"
@@ -1792,6 +1793,24 @@
 	return accounts;
 }
 
+GList *
+gaim_accounts_get_all_active(void)
+{
+	GList *list = NULL;
+	GList *all = gaim_accounts_get_all();
+
+	while (all != NULL) {
+		GaimAccount *account = all->data;
+
+		if (gaim_account_get_enabled(account, gaim_core_get_ui()))
+			list = g_list_append(list, account);
+
+		all = all->next;
+	}
+
+	return list;
+}
+
 GaimAccount *
 gaim_accounts_find(const char *name, const char *protocol_id)
 {

mercurial