Index: configure.in
===================================================================
--- configure.in	(revision 385)
+++ configure.in	(working copy)
@@ -34,7 +34,7 @@
 DBUS_REQUIRED=1.0
 DBUS_GLIB_REQUIRED=0.60
 GUPNP_AV_REQUIRED=0.2.1
-EMPATHY_REQUIRED=2.23.91
+EMPATHY_REQUIRED=2.25.5
 EMPATHY_GTK_REQUIRED=2.25.2
 
 AC_SUBST(GLIB_REQUIRED)
Index: src/plugins/empathy/empathy.c
===================================================================
--- src/plugins/empathy/empathy.c	(revision 385)
+++ src/plugins/empathy/empathy.c	(working copy)
@@ -48,6 +48,7 @@
 
   g_print ("Init %s plugin\n", plugin->info->id);
 
+  empathy_init ();
   empathy_debug_set_flags (g_getenv ("EMPATHY_DEBUG"));
 
   mc = empathy_mission_control_new ();
@@ -76,7 +77,7 @@
 
   /* TODO: Replace all this with EmpathyContactSelector once it's fixed up and
    * merged into libempathy-gtk. */
-  manager = empathy_contact_manager_new ();
+  manager = empathy_contact_manager_dup_singleton ();
   store = empathy_contact_list_store_new (EMPATHY_CONTACT_LIST (manager));
 
   empathy_contact_list_store_set_is_compact (store, TRUE);
@@ -140,6 +141,24 @@
   return TRUE;
 }
 
+static void
+send_file_cb (EmpathyDispatchOperation *dispatch,
+              const GError *error,
+              gpointer user_data)
+{
+  if (error)
+    {
+      GtkWidget *dialog;
+      dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,
+          GTK_BUTTONS_CLOSE,
+          error->message ? error->message : _("No error message"));
+      gtk_dialog_run (GTK_DIALOG (dialog));
+      gtk_widget_destroy (dialog);
+    }
+
+  gtk_main_quit ();
+}
+
 static gboolean
 send_files (NstPlugin *plugin,
             GtkWidget *contact_widget,
@@ -155,17 +174,51 @@
     {
       gchar *path = l->data;
       GFile *file;
+      GFileInfo *info;
+      GError *error = NULL;
+      GTimeVal mod_timeval;
 
-      file = g_file_new_for_uri (path);
-      empathy_dispatcher_send_file (contact, file);
+      file = g_file_new_for_path (path);
 
+      info = g_file_query_info (file,
+          G_FILE_ATTRIBUTE_STANDARD_SIZE ","
+          G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE ","
+          G_FILE_ATTRIBUTE_TIME_MODIFIED ","
+          G_FILE_ATTRIBUTE_STANDARD_NAME,
+          0, NULL, &error);
+
+      if (error)
+        {
+          GtkWidget *dialog;
+          dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,
+              GTK_BUTTONS_CLOSE, "Failed to get information for %s",
+              path);
+          gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+              error->message ? error->message : _("No error message"));
+          gtk_dialog_run (GTK_DIALOG (dialog));
+          gtk_widget_destroy (dialog);
+
+          g_object_unref (file);
+          g_object_unref (contact);
+          return TRUE;
+        }
+
+      g_file_info_get_modification_time (info, &mod_timeval);
+
+      empathy_dispatcher_dup_singleton ();
+      empathy_dispatcher_send_file_to_contact (contact,
+          g_file_info_get_name (info),
+          g_file_info_get_size (info),
+          mod_timeval.tv_sec,
+          g_file_info_get_content_type (info),
+          send_file_cb, NULL);
+
       g_object_unref (file);
-      g_free (path);
     }
 
   g_object_unref (contact);
 
-  return TRUE;
+  return FALSE;
 }
 
 static gboolean
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 386)
+++ ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2009-01-13  Jonny Lamb  <jonny.lamb@collabora.co.uk>
+
+	* configure.in: Bumped dependency on libempathy.
+	* src/plugins/empathy/empathy.c: Moved plugin to use the new channel
+	dispatcher in libempathy. (Closes: #567596)
+
 ========= nautilus-sendto 1.1.1 =========
 
 2009-01-10  Bastien Nocera  <hadess@hadess.net>
