[next] telepathy-salut: Swap "handle type" terminology to "entity type"

Simon McVittie smcv at kemper.freedesktop.org
Tue Apr 8 12:20:07 PDT 2014


Module: telepathy-salut
Branch: next
Commit: dbb2526976030e2e2298863be54ed43f33ce17c8
URL:    http://cgit.freedesktop.org/telepathy/telepathy-salut/commit/?id=dbb2526976030e2e2298863be54ed43f33ce17c8

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Mon Apr  7 14:00:19 2014 +0100

Swap "handle type" terminology to "entity type"

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=77139

---

 src/muc-manager.c          |    8 ++++----
 src/roomlist-manager.c     |    8 ++++----
 src/text-helper.c          |    6 +++---
 src/tube-dbus.c            |    6 +++---
 src/tube-dbus.h            |    2 +-
 src/tube-iface.c           |    4 ++--
 src/tube-stream.c          |    4 ++--
 src/tube-stream.h          |    2 +-
 src/write-mgr-file.c       |   14 +++++++-------
 tests/twisted/constants.py |    2 ++
 10 files changed, 29 insertions(+), 27 deletions(-)

diff --git a/src/muc-manager.c b/src/muc-manager.c
index 3ed1f9d..f9d5846 100644
--- a/src/muc-manager.c
+++ b/src/muc-manager.c
@@ -348,17 +348,17 @@ salut_muc_manager_type_foreach_channel_class (GType type,
 {
   GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
       NULL, (GDestroyNotify) tp_g_value_slice_free);
-  GValue *channel_type_value, *handle_type_value;
+  GValue *channel_type_value, *entity_type_value;
 
   channel_type_value = tp_g_value_slice_new (G_TYPE_STRING);
   /* no string value yet - we'll change it for each channel class */
   g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType",
       channel_type_value);
 
-  handle_type_value = tp_g_value_slice_new (G_TYPE_UINT);
-  g_value_set_uint (handle_type_value, TP_ENTITY_TYPE_ROOM);
+  entity_type_value = tp_g_value_slice_new (G_TYPE_UINT);
+  g_value_set_uint (entity_type_value, TP_ENTITY_TYPE_ROOM);
   g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetEntityType",
-      handle_type_value);
+      entity_type_value);
 
   /* im.telepathy.v1.Channel.Type.Text */
   g_value_set_static_string (channel_type_value, TP_IFACE_CHANNEL_TYPE_TEXT);
diff --git a/src/roomlist-manager.c b/src/roomlist-manager.c
index b3b5254..dd8a69d 100644
--- a/src/roomlist-manager.c
+++ b/src/roomlist-manager.c
@@ -297,7 +297,7 @@ salut_roomlist_manager_type_foreach_channel_class (GType type,
 {
   GHashTable *table = g_hash_table_new_full (g_str_hash, g_str_equal,
       NULL, (GDestroyNotify) tp_g_value_slice_free);
-  GValue *channel_type_value, *handle_type_value;
+  GValue *channel_type_value, *entity_type_value;
 
   channel_type_value = tp_g_value_slice_new (G_TYPE_STRING);
   g_value_set_static_string (channel_type_value,
@@ -305,10 +305,10 @@ salut_roomlist_manager_type_foreach_channel_class (GType type,
   g_hash_table_insert (table, TP_IFACE_CHANNEL ".ChannelType",
       channel_type_value);
 
-  handle_type_value = tp_g_value_slice_new (G_TYPE_UINT);
-  g_value_set_uint (handle_type_value, TP_ENTITY_TYPE_NONE);
+  entity_type_value = tp_g_value_slice_new (G_TYPE_UINT);
+  g_value_set_uint (entity_type_value, TP_ENTITY_TYPE_NONE);
   g_hash_table_insert (table, TP_IFACE_CHANNEL ".TargetEntityType",
-      handle_type_value);
+      entity_type_value);
 
   func (type, table, roomlist_channel_allowed_properties,
       user_data);
diff --git a/src/text-helper.c b/src/text-helper.c
index 68455f7..7a00d3d 100644
--- a/src/text-helper.c
+++ b/src/text-helper.c
@@ -305,14 +305,14 @@ text_helper_report_delivery_error (TpSvcChannel *self,
 {
   TpBaseConnection *base_conn;
   TpHandle handle;
-  guint handle_type;
+  guint entity_type;
   TpMessage *message;
   TpMessage *delivery_echo;
 
   g_object_get (self,
       "connection", &base_conn,
       "handle", &handle,
-      "handle-type", &handle_type,
+      "entity-type", &entity_type,
       NULL);
 
   delivery_echo = tp_cm_message_new (base_conn, 2);
@@ -325,7 +325,7 @@ text_helper_report_delivery_error (TpSvcChannel *self,
 
   message = tp_cm_message_new (base_conn, 1);
 
-  if (handle_type == TP_ENTITY_TYPE_CONTACT)
+  if (entity_type == TP_ENTITY_TYPE_CONTACT)
     tp_cm_message_set_sender (message, handle);
 
   tp_message_set_uint32 (message, 0, "message-type",
diff --git a/src/tube-dbus.c b/src/tube-dbus.c
index 85522f4..ec6f237 100644
--- a/src/tube-dbus.c
+++ b/src/tube-dbus.c
@@ -948,7 +948,7 @@ salut_tube_dbus_class_init (SalutTubeDBusClass *salut_tube_dbus_class)
       "muc-connection",
       "GibberMucConnection object",
       "Gibber MUC connection object used to carry messages for this "
-      "tube if it has a HANDLE_TYPE_ROOM handle",
+      "tube if it has a TP_ENTITY_TYPE_ROOM handle",
       GIBBER_TYPE_MUC_CONNECTION,
       G_PARAM_CONSTRUCT_ONLY |
       G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
@@ -1303,7 +1303,7 @@ data_received_cb (GibberBytestreamIface *stream,
 SalutTubeDBus *
 salut_tube_dbus_new (SalutConnection *conn,
                      TpHandle handle,
-                     TpEntityType handle_type,
+                     TpEntityType entity_type,
                      TpHandle self_handle,
                      GibberMucConnection *muc_connection,
                      TpHandle initiator,
@@ -1315,7 +1315,7 @@ salut_tube_dbus_new (SalutConnection *conn,
   SalutTubeDBus *tube;
   GType gtype = SALUT_TYPE_TUBE_DBUS;
 
-  if (handle_type == TP_ENTITY_TYPE_ROOM)
+  if (entity_type == TP_ENTITY_TYPE_ROOM)
     gtype = SALUT_TYPE_MUC_TUBE_DBUS;
 
   tube = g_object_new (gtype,
diff --git a/src/tube-dbus.h b/src/tube-dbus.h
index 7d68634..7dba712 100644
--- a/src/tube-dbus.h
+++ b/src/tube-dbus.h
@@ -65,7 +65,7 @@ GType salut_tube_dbus_get_type (void);
 
 SalutTubeDBus *
 salut_tube_dbus_new (SalutConnection *conn,
-    TpHandle handle, TpEntityType handle_type, TpHandle self_handle,
+    TpHandle handle, TpEntityType entity_type, TpHandle self_handle,
     GibberMucConnection *muc_connection, TpHandle initiator,
     const gchar *service, GHashTable *parameters, guint64 id,
     gboolean requested);
diff --git a/src/tube-iface.c b/src/tube-iface.c
index b4610a4..1a9959f 100644
--- a/src/tube-iface.c
+++ b/src/tube-iface.c
@@ -113,8 +113,8 @@ salut_tube_iface_base_init (gpointer klass)
       g_object_interface_install_property (klass, param_spec);
 
       param_spec = g_param_spec_uint (
-          "handle-type",
-          "Handle type",
+          "entity-type",
+          "Entity type",
           "The TpEntityType of the handle associated with the tubes channel"
           "that owns this D-Bus tube object.",
           0, G_MAXUINT32, 0,
diff --git a/src/tube-stream.c b/src/tube-stream.c
index 682cfc0..e648cbc 100644
--- a/src/tube-stream.c
+++ b/src/tube-stream.c
@@ -1509,7 +1509,7 @@ data_received_cb (GibberBytestreamIface *bytestream,
 SalutTubeStream *
 salut_tube_stream_new (SalutConnection *conn,
                        TpHandle handle,
-                       TpEntityType handle_type,
+                       TpEntityType entity_type,
                        TpHandle self_handle,
                        TpHandle initiator,
                        gboolean offered,
@@ -1523,7 +1523,7 @@ salut_tube_stream_new (SalutConnection *conn,
   SalutTubeStream *obj;
   GType gtype = SALUT_TYPE_TUBE_STREAM;
 
-  if (handle_type == TP_ENTITY_TYPE_ROOM)
+  if (entity_type == TP_ENTITY_TYPE_ROOM)
     gtype = SALUT_TYPE_MUC_TUBE_STREAM;
 
   obj = g_object_new (gtype,
diff --git a/src/tube-stream.h b/src/tube-stream.h
index 1808e6d..39dd8f6 100644
--- a/src/tube-stream.h
+++ b/src/tube-stream.h
@@ -64,7 +64,7 @@ GType salut_tube_stream_get_type (void);
 
 SalutTubeStream *salut_tube_stream_new (SalutConnection *conn,
     TpHandle handle,
-    TpEntityType handle_type, TpHandle self_handle, TpHandle initiator,
+    TpEntityType entity_type, TpHandle self_handle, TpHandle initiator,
     gboolean offered, const gchar *service,
     GHashTable *parameters, guint64 id, guint portnum,
     WockyStanza *iq_req, gboolean requested);
diff --git a/src/write-mgr-file.c b/src/write-mgr-file.c
index 780d66d..52c32da 100644
--- a/src/write-mgr-file.c
+++ b/src/write-mgr-file.c
@@ -187,8 +187,8 @@ generate_group_name (GHashTable *props)
   gchar *chan_type = g_ascii_strdown (tp_asv_get_string (props,
       TP_PROP_CHANNEL_CHANNEL_TYPE), -1);
   gchar *chan_type_suffix;
-  gchar *handle_type_name;
-  guint handle_type = tp_asv_get_uint32 (props,
+  gchar *entity_type_name;
+  guint entity_type = tp_asv_get_uint32 (props,
       TP_PROP_CHANNEL_TARGET_ENTITY_TYPE, NULL);
 
   g_assert (chan_type != NULL);
@@ -196,21 +196,21 @@ generate_group_name (GHashTable *props)
   g_assert (chan_type_suffix != NULL);
   chan_type_suffix++;
 
-  switch (handle_type)
+  switch (entity_type)
     {
     case TP_ENTITY_TYPE_CONTACT:
-      handle_type_name = "-1on1";
+      entity_type_name = "-1on1";
       break;
 
     case TP_ENTITY_TYPE_ROOM:
-      handle_type_name = "-multi";
+      entity_type_name = "-multi";
       break;
 
     default:
-      handle_type_name = "";
+      entity_type_name = "";
     }
 
-  retval = g_strdup_printf ("%s%s-%d", chan_type_suffix, handle_type_name,
+  retval = g_strdup_printf ("%s%s-%d", chan_type_suffix, entity_type_name,
       ++counter);
 
   g_free (chan_type);
diff --git a/tests/twisted/constants.py b/tests/twisted/constants.py
index 1a2678f..fe81ded 100644
--- a/tests/twisted/constants.py
+++ b/tests/twisted/constants.py
@@ -62,6 +62,8 @@ CHANNEL_TYPE_SERVER_TLS_CONNECTION = \
     CHANNEL + ".Type.ServerTLSConnection1"
 
 CHANNEL_TYPE = CHANNEL + '.ChannelType'
+TARGET_ENTITY_TYPE = CHANNEL + '.TargetEntityType'
+# let's leave this as a synonym to reduce tests' diff churn in CMs
 TARGET_HANDLE_TYPE = CHANNEL + '.TargetEntityType'
 TARGET_HANDLE = CHANNEL + '.TargetHandle'
 TARGET_ID = CHANNEL + '.TargetID'



More information about the telepathy-commits mailing list