[Telepathy-commits] [telepathy-glib/master] BaseConnection: add _{set, get}_self_handle

Will Thompson will.thompson at collabora.co.uk
Thu Aug 28 08:51:31 PDT 2008


---
 telepathy-glib/base-connection.c |   32 ++++++++++++++++++++++++++++++++
 telepathy-glib/base-connection.h |    5 +++++
 2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/telepathy-glib/base-connection.c b/telepathy-glib/base-connection.c
index 4ac746f..ef3c4bc 100644
--- a/telepathy-glib/base-connection.c
+++ b/telepathy-glib/base-connection.c
@@ -1469,6 +1469,38 @@ tp_base_connection_get_handles (TpBaseConnection *self,
   return priv->handles[handle_type];
 }
 
+
+/**
+ * tp_base_connection_get_self_handle:
+ * @self: A connection
+ *
+ * Returns the #TpBaseConnection:self-handle property, which is guaranteed not
+ * to be 0 once the connection has moved to the CONNECTED state.
+ *
+ * Returns: the current self handle of the connection.
+ */
+TpHandle
+tp_base_connection_get_self_handle (TpBaseConnection *self)
+{
+  return self->self_handle;
+}
+
+/**
+ * tp_base_connection_set_self_handle:
+ * @self: A connection
+ * @self_handle: The new self handle for the connection.
+ *
+ * Sets the #TpBaseConnection:self-handle property.  self_handle may not be 0
+ * once the connection has moved to the CONNECTED state.
+ */
+void
+tp_base_connection_set_self_handle (TpBaseConnection *self,
+                                    TpHandle self_handle)
+{
+  g_object_set (self, "self-handle", self_handle, NULL);
+}
+
+
 /**
  * tp_base_connection_finish_shutdown:
  * @self: The connection
diff --git a/telepathy-glib/base-connection.h b/telepathy-glib/base-connection.h
index cad945a..6b806e2 100644
--- a/telepathy-glib/base-connection.h
+++ b/telepathy-glib/base-connection.h
@@ -255,6 +255,11 @@ gboolean tp_base_connection_register (TpBaseConnection *self,
 void tp_base_connection_change_status (TpBaseConnection *self,
     TpConnectionStatus status, TpConnectionStatusReason reason);
 
+TpHandle tp_base_connection_get_self_handle (TpBaseConnection *self);
+
+void tp_base_connection_set_self_handle (TpBaseConnection *self,
+    TpHandle self_handle);
+
 void tp_base_connection_finish_shutdown (TpBaseConnection *self);
 
 void tp_base_connection_add_interfaces (TpBaseConnection *self,
-- 
1.5.6.3




More information about the Telepathy-commits mailing list