empathy r1022 - trunk/libempathy



Author: xclaesse
Date: Mon Apr 21 14:06:39 2008
New Revision: 1022
URL: http://svn.gnome.org/viewvc/empathy?rev=1022&view=rev

Log:
Fix OUTGOING calls


Modified:
   trunk/libempathy/empathy-tp-call.c
   trunk/libempathy/empathy-tp-group.c

Modified: trunk/libempathy/empathy-tp-call.c
==============================================================================
--- trunk/libempathy/empathy-tp-call.c	(original)
+++ trunk/libempathy/empathy-tp-call.c	Mon Apr 21 14:06:39 2008
@@ -282,24 +282,6 @@
 }
 
 static void
-tp_call_group_ready_cb (EmpathyTpCall *call)
-{
-  EmpathyTpCallPriv  *priv = GET_PRIV (call);
-  EmpathyPendingInfo *invitation;
-
-  invitation = empathy_tp_group_get_invitation (priv->group, &priv->contact);
-  priv->is_incoming = (invitation != NULL);
-  priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
-
-  if (!priv->is_incoming)
-      tp_call_request_streams (call);
-
-  g_object_notify (G_OBJECT (call), "is-incoming");
-  g_object_notify (G_OBJECT (call), "contact");
-  g_object_notify (G_OBJECT (call), "status");
-}
-
-static void
 tp_call_member_added_cb (EmpathyTpGroup *group,
                          EmpathyContact *contact,
                          EmpathyContact *actor,
@@ -319,6 +301,49 @@
 }
 
 static void
+tp_call_local_pending_cb (EmpathyTpGroup *group,
+                          EmpathyContact *contact,
+                          EmpathyContact *actor,
+                          guint reason,
+                          const gchar *message,
+                          EmpathyTpCall *call)
+{
+  EmpathyTpCallPriv *priv = GET_PRIV (call);
+
+  if (!priv->contact && !empathy_contact_is_user (contact))
+    {
+      priv->contact = g_object_ref (contact);
+      priv->is_incoming = TRUE;
+      priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
+      g_object_notify (G_OBJECT (call), "is-incoming");
+      g_object_notify (G_OBJECT (call), "contact"); 
+      g_object_notify (G_OBJECT (call), "status");	
+    }
+}
+
+static void
+tp_call_remote_pending_cb (EmpathyTpGroup *group,
+                           EmpathyContact *contact,
+                           EmpathyContact *actor,
+                           guint reason,
+                           const gchar *message,
+                           EmpathyTpCall *call)
+{
+  EmpathyTpCallPriv *priv = GET_PRIV (call);
+
+  if (!priv->contact && !empathy_contact_is_user (contact))
+    {
+      priv->contact = g_object_ref (contact);
+      priv->is_incoming = FALSE;
+      priv->status = EMPATHY_TP_CALL_STATUS_PENDING;
+      tp_call_request_streams (call);
+      g_object_notify (G_OBJECT (call), "is-incoming");
+      g_object_notify (G_OBJECT (call), "contact"); 
+      g_object_notify (G_OBJECT (call), "status");	
+    }
+}
+
+static void
 tp_call_channel_invalidated_cb (TpChannel     *channel,
                                 GQuark         domain,
                                 gint           code,
@@ -356,8 +381,7 @@
   empathy_debug (DEBUG_DOMAIN, "Closing channel");
 
   tp_cli_channel_call_close (priv->channel, -1,
-      (tp_cli_channel_callback_for_close) tp_call_async_cb,
-      "closing channel", NULL, G_OBJECT (call));
+      NULL, NULL, NULL, NULL);
 
   priv->status = EMPATHY_TP_CALL_STATUS_CLOSED;
   g_object_notify (G_OBJECT (call), "status");
@@ -484,14 +508,12 @@
   /* Setup group interface */
   priv->group = empathy_tp_group_new (priv->channel);
 
-  g_signal_connect (G_OBJECT (priv->group), "member-added",
+  g_signal_connect (priv->group, "member-added",
       G_CALLBACK (tp_call_member_added_cb), call);
-
-  if (empathy_tp_group_is_ready (priv->group))
-      tp_call_group_ready_cb (call);
-  else
-      g_signal_connect_swapped (priv->group, "notify::ready",
-          G_CALLBACK (tp_call_group_ready_cb), call);
+  g_signal_connect (priv->group, "local-pending",
+      G_CALLBACK (tp_call_local_pending_cb), call);
+  g_signal_connect (priv->group, "remote-pending",
+      G_CALLBACK (tp_call_remote_pending_cb), call);
 
   /* Start stream engine */
   tp_call_stream_engine_handle_channel (call);
@@ -514,6 +536,7 @@
     {
       g_signal_handlers_disconnect_by_func (priv->channel,
           tp_call_channel_invalidated_cb, object);
+      tp_call_close_channel (EMPATHY_TP_CALL (object));
       g_object_unref (priv->channel);
     }
 

Modified: trunk/libempathy/empathy-tp-group.c
==============================================================================
--- trunk/libempathy/empathy-tp-group.c	(original)
+++ trunk/libempathy/empathy-tp-group.c	Mon Apr 21 14:06:39 2008
@@ -966,7 +966,7 @@
 		contact = priv->remote_pendings->data;
 	}
 
-	if (remote_contact) {
+	if (remote_contact && contact) {
 		*remote_contact = g_object_ref (contact);
 	}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]