diff --git a/src/calls-account.c b/src/calls-account.c index 4dde349..cebf7e3 100644 --- a/src/calls-account.c +++ b/src/calls-account.c @@ -70,3 +70,21 @@ calls_account_go_online (CallsAccount *self, return iface->go_online (self, online); } + +/** + * calls_account_get_state: + * @self: A #CallsAccount + * + * Returns: The current #CallsAccountState of this account + */ +CallsAccountState +calls_account_get_state (CallsAccount *self) +{ + CallsAccountState state; + + g_return_val_if_fail (CALLS_IS_ACCOUNT (self), CALLS_ACCOUNT_NULL); + + g_object_get (self, "account-state", &state, NULL); + + return state; +} diff --git a/src/calls-account.h b/src/calls-account.h index 1585f30..b350115 100644 --- a/src/calls-account.h +++ b/src/calls-account.h @@ -69,5 +69,6 @@ typedef enum { void calls_account_go_online (CallsAccount *self, gboolean online); +CallsAccountState calls_account_get_state (CallsAccount *self); G_END_DECLS