]> git.0d.be Git - empathy.git/blobdiff - src/empathy-call-window.c
Add Marco Barisione to CONTRIBUTORS
[empathy.git] / src / empathy-call-window.c
index 7c451dad4bcad3d326244b2bc4751b2229999361..8edf6817c1a7c934dc38d7b873f617f8a88ea10e 100644 (file)
@@ -30,6 +30,7 @@
 
 #include <libempathy/empathy-contact.h>
 #include <libempathy/empathy-tp-call.h>
+#include <libempathy/empathy-tp-group.h>
 #include <libempathy/empathy-utils.h>
 #include <libempathy-gtk/empathy-ui-utils.h>
 
@@ -340,7 +341,6 @@ call_window_update (EmpathyCallWindow *window)
   EmpathyTpCallStream *audio_stream;
   EmpathyTpCallStream *video_stream;
   gboolean is_incoming;
-  gboolean has_dtmf;
   gchar *title;
 
   g_object_get (window->call,
@@ -349,7 +349,6 @@ call_window_update (EmpathyCallWindow *window)
       "video-stream", &video_stream,
       "contact", &contact,
       "is-incoming", &is_incoming,
-      "has-dtmf", &has_dtmf,
       NULL);
 
   if (video_stream->state > audio_stream->state)
@@ -361,7 +360,7 @@ call_window_update (EmpathyCallWindow *window)
       "is-incoming: %d video-stream direction: %d",
       window->status, stream_state, is_incoming, video_stream->direction);
 
-  if (has_dtmf)
+  if (empathy_tp_call_has_dtmf (window->call))
     {
       gtk_widget_show (window->keypad_expander);
     }
@@ -378,6 +377,8 @@ call_window_update (EmpathyCallWindow *window)
   if (window->status == EMPATHY_TP_CALL_STATUS_READYING)
     {
       gtk_window_set_title (GTK_WINDOW (window->window), _("Empathy Call"));
+      /* To translators: Readying is the first state of the call, it is
+       * preparing the connection and it does not yet ring. */
       gtk_label_set_text (GTK_LABEL (window->status_label), _("Readying"));
       gtk_widget_set_sensitive (window->video_button, FALSE);
       gtk_widget_set_sensitive (window->output_volume_button, FALSE);
@@ -506,8 +507,12 @@ empathy_call_window_new (TpChannel *channel)
         {
           GtkWidget *dialog;
           EmpathyContact *contact;
-          g_object_get (window->call,
-              "contact", &contact,
+          EmpathyTpGroup *tp_group;
+
+          tp_group = empathy_tp_group_new (channel);
+          empathy_run_until_ready (tp_group);
+          empathy_tp_group_get_invitation (tp_group, &contact);
+          empathy_contact_run_until_ready (contact, EMPATHY_CONTACT_READY_NAME,
               NULL);
 
           /* We don't want to have multiple calls running.
@@ -516,9 +521,11 @@ empathy_call_window_new (TpChannel *channel)
 
           dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_INFO,
               GTK_BUTTONS_CLOSE,
-              _("Incoming call from %s rejected because there is already a running call."), empathy_contact_get_name (contact));
+              _("Incoming call from %s rejected because there is already a"
+                " running call."), empathy_contact_get_name (contact));
 
-          g_object_unref (window->call);
+          g_object_unref (contact);
+          g_object_unref (tp_group);
 
           g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy),
               NULL);