telepathy-gabble: private-tubes-factory: ensure (not lookup) handles from tube invites

Jonny Lamb jonny at kemper.freedesktop.org
Tue Aug 28 06:19:34 PDT 2012


Module: telepathy-gabble
Branch: master
Commit: 77dafcbc1a7f1de2c6de8f82fd60c3b7eac2a3d3
URL:    http://cgit.freedesktop.org/telepathy/telepathy-gabble/commit/?id=77dafcbc1a7f1de2c6de8f82fd60c3b7eac2a3d3

Author: Jonny Lamb <jonny.lamb at collabora.co.uk>
Date:   Fri Jul 20 12:03:50 2012 +0100

private-tubes-factory: ensure (not lookup) handles from tube invites

Signed-off-by: Jonny Lamb <jonny.lamb at collabora.co.uk>

---

 src/private-tubes-factory.c |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/private-tubes-factory.c b/src/private-tubes-factory.c
index f2d6268..b27b9e3 100644
--- a/src/private-tubes-factory.c
+++ b/src/private-tubes-factory.c
@@ -1154,6 +1154,11 @@ new_channel_from_stanza (GabblePrivateTubesFactory *self,
   const gchar *service;
   GHashTable *parameters;
 
+  /* the validity of this has already been checked by wocky */
+  handle = tp_handle_ensure (contact_repo,
+      wocky_stanza_get_from (stanza), NULL, NULL);
+  g_return_val_if_fail (handle != 0, NULL);
+
   if (!gabble_private_tubes_factory_extract_tube_information (
           contact_repo, tube_node, &type, NULL,
           &service, &parameters, NULL))
@@ -1179,10 +1184,6 @@ new_channel_from_stanza (GabblePrivateTubesFactory *self,
       return NULL;
     }
 
-  /* this has already been checked */
-  handle = tp_handle_lookup (contact_repo,
-      wocky_stanza_get_from (stanza), NULL, NULL);
-
   if (type == TP_TUBE_TYPE_STREAM)
     {
       tube = GABBLE_TUBE_IFACE (gabble_tube_stream_new (priv->conn,



More information about the telepathy-commits mailing list