[Telepathy-commits] [telepathy-gabble/master] make create_room_identity return self_handle directly

Robert McQueen robert.mcqueen at collabora.co.uk
Tue Aug 19 10:54:05 PDT 2008


20080727004430-418b8-c00dcfa62df21c31893466886a30c422e11dbb76.gz
---
 src/muc-channel.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/src/muc-channel.c b/src/muc-channel.c
index 1213b2d..fcfa5ee 100644
--- a/src/muc-channel.c
+++ b/src/muc-channel.c
@@ -278,8 +278,8 @@ gabble_muc_channel_init (GabbleMucChannel *obj)
 }
 
 
-static void create_room_identity (GabbleMucChannel *, TpHandle *);
-
+static TpHandle create_room_identity (GabbleMucChannel *)
+  G_GNUC_WARN_UNUSED_RESULT;
 
 static GObject *
 gabble_muc_channel_constructor (GType type, guint n_props,
@@ -314,7 +314,7 @@ gabble_muc_channel_constructor (GType type, guint n_props,
   tp_handle_ref (contact_handles, priv->initiator);
 
   /* create our own identity in the room */
-  create_room_identity (self, &self_handle);
+  self_handle = create_room_identity (self);
   /* this causes us to have one ref to the self handle which is unreffed
    * at the end of this function */
 
@@ -650,9 +650,8 @@ room_properties_update (GabbleMucChannel *chan)
     }
 }
 
-static void
-create_room_identity (GabbleMucChannel *chan,
-                      TpHandle *room_handle)
+static TpHandle
+create_room_identity (GabbleMucChannel *chan)
 {
   GabbleMucChannelPrivate *priv;
   TpBaseConnection *conn;
@@ -674,11 +673,8 @@ create_room_identity (GabbleMucChannel *chan,
 
   g_free (alias);
 
-  if (room_handle)
-    {
-      *room_handle = tp_handle_ensure (contact_repo, priv->self_jid->str,
-          GUINT_TO_POINTER (GABBLE_JID_ROOM_MEMBER), NULL);
-    }
+  return tp_handle_ensure (contact_repo, priv->self_jid->str,
+      GUINT_TO_POINTER (GABBLE_JID_ROOM_MEMBER), NULL);
 }
 
 static LmMessage *
-- 
1.5.6.3




More information about the Telepathy-commits mailing list