4 #include "dbus-useful.h"
5 #include "conversation.h"
10 purple_accounts_find_ext(const char *name
, const char *protocol_id
,
11 gboolean (*account_test
)(const PurpleAccount
*account
))
13 PurpleAccount
*result
= NULL
;
18 who
= g_strdup(purple_normalize(NULL
, name
));
22 for (l
= purple_accounts_get_all(); l
!= NULL
; l
= l
->next
) {
23 PurpleAccount
*account
= (PurpleAccount
*)l
->data
;
25 if (who
&& strcmp(purple_normalize(NULL
, purple_account_get_username(account
)), who
))
28 if (protocol_id
&& strcmp(account
->protocol_id
, protocol_id
))
31 if (account_test
&& !account_test(account
))
43 PurpleAccount
*purple_accounts_find_any(const char *name
, const char *protocol
)
45 return purple_accounts_find_ext(name
, protocol
, NULL
);
48 PurpleAccount
*purple_accounts_find_connected(const char *name
, const char *protocol
)
50 return purple_accounts_find_ext(name
, protocol
, purple_account_is_connected
);