[Telepathy-commits] [telepathy-gabble/master] GabbleMUCFactory: don't redundantly validate TargetHandle

Simon McVittie simon.mcvittie at collabora.co.uk
Wed Nov 5 03:48:32 PST 2008


TpBaseConnection already checks it, so we don't need to do so again.
---
 src/muc-factory.c |    7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/muc-factory.c b/src/muc-factory.c
index acdcf50..8f17f8e 100644
--- a/src/muc-factory.c
+++ b/src/muc-factory.c
@@ -1304,8 +1304,6 @@ gabble_muc_factory_request (GabbleMucFactory *self,
 {
   GabbleMucFactoryPrivate *priv = GABBLE_MUC_FACTORY_GET_PRIVATE (self);
   TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn;
-  TpHandleRepoIface *room_repo = tp_base_connection_get_handles (base_conn,
-      TP_HANDLE_TYPE_ROOM);
   GError *error = NULL;
   TpHandle handle;
   const gchar *channel_type;
@@ -1316,11 +1314,10 @@ gabble_muc_factory_request (GabbleMucFactory *self,
       TP_IFACE_CHANNEL ".TargetHandleType", NULL) != TP_HANDLE_TYPE_ROOM)
     return FALSE;
 
+  /* validity already checked by TpBaseConnection */
   handle = tp_asv_get_uint32 (request_properties,
       TP_IFACE_CHANNEL ".TargetHandle", NULL);
-
-  if (!tp_handle_is_valid (room_repo, handle, &error))
-    goto error;
+  g_assert (handle != 0);
 
   channel_type = tp_asv_get_string (request_properties,
       TP_IFACE_CHANNEL ".ChannelType");
-- 
1.5.6.5




More information about the Telepathy-commits mailing list