[calls] account: Add API to query account state
- From: Evangelos Ribeiro Tzaras <devrtz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [calls] account: Add API to query account state
- Date: Tue, 20 Jul 2021 10:33:27 +0000 (UTC)
commit dd3fbf646e105299a4e2d2eab1643bb11c3a8113
Author: Evangelos Ribeiro Tzaras <evangelos tzaras puri sm>
Date: Sun Jul 4 00:24:00 2021 +0200
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 4dde3494..cebf7e3e 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 1585f30a..b3501150 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]