From dd3fbf646e105299a4e2d2eab1643bb11c3a8113 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Sun, 4 Jul 2021 00:24:00 +0200 Subject: [PATCH] account: Add API to query account state --- src/calls-account.c | 18 ++++++++++++++++++ src/calls-account.h | 1 + 2 files changed, 19 insertions(+) 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