]> git.0d.be Git - empathy.git/blobdiff - src/empathy-event-manager.c
The incoming call dialog doesn't have to be modal. Fixes #576384
[empathy.git] / src / empathy-event-manager.c
index 4efb7078e5723e947fd639706b5cc665b7e9ac61..0b4fa775a73157045907cb52d2017d89011daf28 100644 (file)
@@ -373,8 +373,7 @@ event_channel_process_voip_func (EventPriv *event)
       return;
     }
 
-  dialog = gtk_message_dialog_new (GTK_WINDOW (empathy_main_window_get()),
-      GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+  dialog = gtk_message_dialog_new (NULL, 0,
       GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, _("Incoming call"));
   gtk_message_dialog_format_secondary_text (
     GTK_MESSAGE_DIALOG (dialog),
@@ -589,14 +588,22 @@ event_manager_tube_dispatch_ability_cb (GObject *object,
 
 static void
 event_manager_tube_got_contact_cb (EmpathyTpContactFactory *factory,
-                                   GList *contacts,
+                                   EmpathyContact *contact,
+                                   const GError *error,
                                    gpointer user_data,
                                    GObject *object)
 {
   EventManagerApproval *approval = (EventManagerApproval *)user_data;
   EmpathyTubeDispatchAbility dispatchability;
 
-  approval->contact = g_object_ref (contacts->data);
+  if (error != NULL)
+    {
+      /* FIXME: We should probably still display the event */
+      DEBUG ("Error: %s", error->message);
+      return;
+    }
+
+  approval->contact = g_object_ref (contact);
 
   dispatchability = empathy_tube_dispatch_is_dispatchable
     (approval->tube_dispatch);
@@ -705,7 +712,8 @@ event_room_channel_process_func (EventPriv *event)
 
 static void
 event_manager_muc_invite_got_contact_cb (EmpathyTpContactFactory *factory,
-                                         GList *contacts,
+                                         EmpathyContact *contact,
+                                         const GError *error,
                                          gpointer user_data,
                                          GObject *object)
 {
@@ -715,7 +723,14 @@ event_manager_muc_invite_got_contact_cb (EmpathyTpContactFactory *factory,
   gchar *msg;
   TpHandle self_handle;
 
-  approval->contact = g_object_ref (contacts->data);
+  if (error != NULL)
+    {
+      /* FIXME: We should probably still display the event */
+      DEBUG ("Error: %s", error->message);
+      return;
+    }
+
+  approval->contact = g_object_ref (contact);
   channel = empathy_dispatch_operation_get_channel (approval->operation);
 
   self_handle = tp_channel_group_get_self_handle (channel);
@@ -785,8 +800,8 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
               connection = empathy_tp_chat_get_connection (tp_chat);
               factory = empathy_tp_contact_factory_dup_singleton (connection);
 
-              empathy_tp_contact_factory_get_from_handles (factory,
-                  1, &inviter, event_manager_muc_invite_got_contact_cb,
+              empathy_tp_contact_factory_get_from_handle (factory,
+                  inviter, event_manager_muc_invite_got_contact_cb,
                   approval, NULL, G_OBJECT (manager));
 
               g_object_unref (factory);
@@ -861,7 +876,7 @@ event_manager_approve_channel_cb (EmpathyDispatcher *dispatcher,
       approval->tube_dispatch = empathy_tube_dispatch_new (operation);
       connection = tp_channel_borrow_connection (channel);
       factory = empathy_tp_contact_factory_dup_singleton (connection);
-      empathy_tp_contact_factory_get_from_handles (factory, 1, &handle,
+      empathy_tp_contact_factory_get_from_handle (factory, handle,
         event_manager_tube_got_contact_cb, approval, NULL, G_OBJECT (manager));
     }
   else