[Telepathy-commits] [telepathy-gabble/master] GabbleImFactory: keep track of who initiated the channel

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Aug 19 10:53:26 PDT 2008


20080721144015-53eee-2e3a577566a80fb80fc276f0cd9a0491d0c21d6e.gz
---
 src/im-factory.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/im-factory.c b/src/im-factory.c
index 9932ce6..16f7670 100644
--- a/src/im-factory.c
+++ b/src/im-factory.c
@@ -186,7 +186,8 @@ gabble_im_factory_class_init (GabbleImFactoryClass *gabble_im_factory_class)
 
 }
 
-static GabbleIMChannel *new_im_channel (GabbleImFactory *fac, TpHandle handle);
+static GabbleIMChannel *new_im_channel (GabbleImFactory *fac,
+    TpHandle handle, TpHandle initiator);
 
 static void im_channel_closed_cb (GabbleIMChannel *chan, gpointer user_data);
 
@@ -252,7 +253,7 @@ im_factory_message_cb (LmMessageHandler *handler,
 
       DEBUG ("found no IM channel, creating one");
 
-      chan = new_im_channel (fac, handle);
+      chan = new_im_channel (fac, handle, handle);
     }
 
   g_assert (chan != NULL);
@@ -315,7 +316,9 @@ im_channel_closed_cb (GabbleIMChannel *chan, gpointer user_data)
  * new_im_channel
  */
 static GabbleIMChannel *
-new_im_channel (GabbleImFactory *fac, TpHandle handle)
+new_im_channel (GabbleImFactory *fac,
+                TpHandle handle,
+                TpHandle initiator)
 {
   GabbleImFactoryPrivate *priv;
   TpBaseConnection *conn;
@@ -447,8 +450,9 @@ gabble_im_factory_iface_request (TpChannelFactoryIface *iface,
 {
   GabbleImFactory *fac = GABBLE_IM_FACTORY (iface);
   GabbleImFactoryPrivate *priv = GABBLE_IM_FACTORY_GET_PRIVATE (fac);
+  TpBaseConnection *base_conn = (TpBaseConnection *) priv->conn;
   TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
-      (TpBaseConnection *) priv->conn, TP_HANDLE_TYPE_CONTACT);
+      base_conn, TP_HANDLE_TYPE_CONTACT);
   GabbleIMChannel *chan;
   TpChannelFactoryRequestStatus status;
 
@@ -467,7 +471,7 @@ gabble_im_factory_iface_request (TpChannelFactoryIface *iface,
   if (!chan)
     {
       status = TP_CHANNEL_FACTORY_REQUEST_STATUS_CREATED;
-      chan = new_im_channel (fac, handle);
+      chan = new_im_channel (fac, handle, base_conn->self_handle);
     }
 
   g_assert (chan);
-- 
1.5.6.3




More information about the Telepathy-commits mailing list