diff options
author | Gary Kramlich <grim@reaperworld.com> | 2022-11-04 23:55:30 -0500 |
---|---|---|
committer | Gary Kramlich <grim@reaperworld.com> | 2022-11-04 23:55:30 -0500 |
commit | d56ca463f4e91163af4d81dc208d180f376b6ad4 (patch) | |
tree | 1da83c045a62389bb729fcc794b8063e2d43b1cf /libpurple/purpleaccountmanager.h | |
parent | 3d9936baff019f83fd2d893cd67fa2fb5a649e75 (diff) | |
download | pidgin-d56ca463f4e91163af4d81dc208d180f376b6ad4.tar.gz |
Add purple_account_manager_get_connected and port libpurple to it
Generally speaking, purple_connections_get_all is used to get a list of accounts
that are currently connected and then act upon those accounts.
Instead of having a connections API for that, we can just put it into the
account manager which can query the accounts it knows about and check if they
are connected or not making the account the source of truth for whether it is
connected or not.
This also has the benefit of treating the connection as just a data object that
belongs to the account which feels a lot more natural than the existing API.
Testing Done:
Ran and let a bonjour account go idle and verified via another instance of pidgin.
Reviewed at https://reviews.imfreedom.org/r/2031/
Diffstat (limited to 'libpurple/purpleaccountmanager.h')
-rw-r--r-- | libpurple/purpleaccountmanager.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libpurple/purpleaccountmanager.h b/libpurple/purpleaccountmanager.h index d4932d15ce..ff9d7c3578 100644 --- a/libpurple/purpleaccountmanager.h +++ b/libpurple/purpleaccountmanager.h @@ -46,10 +46,8 @@ typedef void (*PurpleAccountManagerForeachFunc)(PurpleAccount *account, gpointer /** * PurpleAccountManager: - * @get_idle_time: vfunc to get the time that the user interface has been idle. * - * An interface that a user interface can implement to let the core determine - * idle times. + * A manager that keeps track of all [class@Purple.Account]s. * * Since: 3.0.0 */ @@ -137,6 +135,19 @@ GList *purple_account_manager_get_enabled(PurpleAccountManager *manager); GList *purple_account_manager_get_disabled(PurpleAccountManager *manager); /** + * purple_account_manager_get_connected: + * @manager: The instance. + * + * Gets a list of all accounts that are currently connected. + * + * Returns: (transfer container) (element-type PurpleAccount): The list of all + * connected accounts. + * + * Since: 3.0.0 + */ +GList *purple_account_manager_get_connected(PurpleAccountManager *manager); + +/** * purple_account_manager_find_by_id: * @manager: The account manager instance. * @id: The id of the account. |