summaryrefslogtreecommitdiff
path: root/telepathy-glib/base-connection.c
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.co.uk>2014-01-24 16:31:53 -0500
committerXavier Claessens <xavier.claessens@collabora.co.uk>2014-02-17 13:54:14 -0500
commit8cc41d121d1579893c2c7f7cc7bc90670170380f (patch)
tree250e1b35f0f4326a499a4e577d33de575d158ad2 /telepathy-glib/base-connection.c
parent5bb624f0cc23d24d13ac9dd4ff0ef9ece0abe9c2 (diff)
TpBaseConnection: add "account-path-suffix" property
Diffstat (limited to 'telepathy-glib/base-connection.c')
-rw-r--r--telepathy-glib/base-connection.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index c44027951..8608dc2ef 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -291,6 +291,7 @@ enum
PROP_DBUS_STATUS,
PROP_DBUS_DAEMON,
PROP_HAS_IMMORTAL_HANDLES,
+ PROP_ACCOUNT_PATH_SUFFIX,
N_PROPS
};
@@ -441,6 +442,8 @@ struct _TpBaseConnectionPrivate
/* GQuark iface => GHashTable {
* unique name borrowed from interested_clients => gsize count } */
GHashTable *client_interests;
+
+ gchar *account_path_suffix;
};
static const gchar * const *tp_base_connection_get_interfaces (
@@ -500,6 +503,10 @@ tp_base_connection_get_property (GObject *object,
g_value_set_boolean (value, TRUE);
break;
+ case PROP_ACCOUNT_PATH_SUFFIX:
+ g_value_set_string (value, self->priv->account_path_suffix);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -537,6 +544,11 @@ tp_base_connection_set_property (GObject *object,
}
break;
+ case PROP_ACCOUNT_PATH_SUFFIX:
+ g_assert (self->priv->account_path_suffix == NULL); /* construct-only */
+ self->priv->account_path_suffix = g_value_dup_string (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
@@ -637,6 +649,7 @@ tp_base_connection_finalize (GObject *object)
g_free (self->object_path);
g_hash_table_unref (priv->client_interests);
g_hash_table_unref (priv->interested_clients);
+ g_free (priv->account_path_suffix);
G_OBJECT_CLASS (tp_base_connection_parent_class)->finalize (object);
}
@@ -1668,6 +1681,27 @@ tp_base_connection_class_init (TpBaseConnectionClass *klass)
g_object_class_install_property (object_class, PROP_HAS_IMMORTAL_HANDLES,
param_spec);
+ /**
+ * TpBaseConnection:account-path-suffix:
+ *
+ * The suffix of the account object path such as
+ * "gabble/jabber/chris_40example_2ecom0" for the account whose object path is
+ * %TP_ACCOUNT_OBJECT_PATH_BASE + "gabble/jabber/chris_40example_2ecom0".
+ * The same as returned by tp_account_get_path_suffix().
+ *
+ * It is given by the AccountManager in the connection parameters. Or %NULL if
+ * the ConnectionManager or the AccountManager are too old.
+ *
+ * Since: 0.UNRELEASED
+ */
+ param_spec = g_param_spec_string ("account-path-suffix",
+ "Account path suffix",
+ "The suffix of the account path",
+ NULL,
+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_ACCOUNT_PATH_SUFFIX,
+ param_spec);
+
/* signal definitions */
/**
@@ -4094,3 +4128,21 @@ tp_base_connection_get_object_path (TpBaseConnection *self)
return self->object_path;
}
+
+/**
+ * tp_base_connection_get_account_path_suffix:
+ * @self: the connection
+ *
+ * <!-- -->
+ *
+ * Returns: the same value has the #TpBaseConnection:account-path-suffix
+ * property.
+ * Since: 0.UNRELEASED
+ */
+const gchar *
+tp_base_connection_get_account_path_suffix (TpBaseConnection *self)
+{
+ g_return_val_if_fail (TP_IS_BASE_CONNECTION (self), NULL);
+
+ return self->priv->account_path_suffix;
+}