diff options
Diffstat (limited to 'telepathy-glib/account.c')
-rw-r--r-- | telepathy-glib/account.c | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index d5bdb95d..4f68b12d 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -94,6 +94,7 @@ struct _TpAccountPrivate { gchar *requested_status; gchar *requested_message; + gboolean changing_presence; gboolean connect_automatically; gboolean has_been_online; @@ -126,6 +127,7 @@ static guint signals[LAST_SIGNAL]; /* properties */ enum { PROP_ENABLED = 1, + PROP_CHANGING_PRESENCE, PROP_CURRENT_PRESENCE_TYPE, PROP_CURRENT_STATUS, PROP_CURRENT_STATUS_MESSAGE, @@ -487,6 +489,17 @@ _tp_account_update (TpAccount *account, } } + if (g_hash_table_lookup (properties, "ChangingPresence") != NULL) + { + gboolean old = priv->changing_presence; + + priv->changing_presence = + tp_asv_get_boolean (properties, "ChangingPresence", NULL); + + if (old != priv->changing_presence) + g_object_notify (G_OBJECT (account), "changing-presence"); + } + if (g_hash_table_lookup (properties, "ConnectAutomatically") != NULL) { gboolean old = priv->connect_automatically; @@ -634,6 +647,9 @@ _tp_account_get_property (GObject *object, case PROP_ICON_NAME: g_value_set_string (value, self->priv->icon_name); break; + case PROP_CHANGING_PRESENCE: + g_value_set_boolean (value, self->priv->changing_presence); + break; case PROP_CONNECT_AUTOMATICALLY: g_value_set_boolean (value, self->priv->connect_automatically); break; @@ -810,6 +826,32 @@ tp_account_class_init (TpAccountClass *klass) G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); /** + * TpAccount:changing-presence: + * + * %TRUE if an attempt is currently being made to change the account's + * presence (#TpAccount:current-presence-type, #TpAccount:current-status + * and #TpAccount:current-status-message) to match its requested presence + * (#TpAccount:requested-presence-type, #TpAccount:requested-status + * and #TpAccount:requested-status-message). + * + * One can receive change notifications on this property by connecting + * to the #GObject::notify signal and using this property as the signal + * detail. + * + * This is not guaranteed to have been retrieved until + * tp_proxy_prepare_async() has finished; until then, the value is + * %FALSE. + * + * Since: 0.11.UNRELEASED + */ + g_object_class_install_property (object_class, PROP_CHANGING_PRESENCE, + g_param_spec_boolean ("changing-presence", + "Changing Presence", + "TRUE if presence is changing", + FALSE, + G_PARAM_STATIC_STRINGS | G_PARAM_READABLE)); + + /** * TpAccount:connection-status: * * The account's connection status type (a %TpConnectionStatus). @@ -2014,6 +2056,24 @@ tp_account_remove_finish (TpAccount *account, } /** + * tp_account_get_changing_presence: + * @self: an account + * + * <!-- --> + * + * Returns: the same as the #TpAccount:changing-presence property + * + * Since: 0.11.UNRELEASED + */ +gboolean +tp_account_get_changing_presence (TpAccount *self) +{ + g_return_val_if_fail (TP_IS_ACCOUNT (self), FALSE); + + return self->priv->changing_presence; +} + +/** * tp_account_get_connect_automatically: * @account: a #TpAccount * |