summaryrefslogtreecommitdiff
blob: b9b330952ff1b3c4521c1b7b5791aeb8084b22dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
From 91aa1610f6ed1d36abe1d7bf1f607616cf8187da Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 09 Jun 2010 16:39:13 +0000
Subject: Remove Empathy plugin

It now lives in Empathy itself.
---
diff --git a/configure.in b/configure.in
index d7318d9..8781f50 100644
--- a/configure.in
+++ b/configure.in
@@ -38,8 +38,6 @@ NAUTILUS_EXTENSION=2.13.3
 DBUS_REQUIRED=1.0
 DBUS_GLIB_REQUIRED=0.60
 GUPNP_REQUIRED=0.13
-EMPATHY_REQUIRED=2.27.91
-EMPATHY_GTK_REQUIRED=2.27.91
 
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(GTHREAD_REQUIRED)
@@ -50,8 +48,6 @@ AC_SUBST(NAUTILUS_EXTENSION)
 AC_SUBST(BLUETOOTH_REQUIRED)
 AC_SUBST(DBUS_REQUIRED)
 AC_SUBST(GUPNP_REQUIRED)
-AC_SUBST(EMPATHY_REQUIRED)
-AC_SUBST(EMPATHY_GTK_REQUIRED)
 
 PKG_CHECK_MODULES(NAUTILUS_SENDTO,\
 	 glib-2.0 >= $GLIB_REQUIRED                \
@@ -82,7 +78,7 @@ AC_MSG_NOTICE([installing nautilus plugin in ${ac_with_nautilusdir}])
 AC_SUBST([NAUTILUS_EXTENSION_DIR],[${ac_with_nautilusdir}])
 
 # The full list of plugins
-allowed_plugins="bluetooth empathy evolution gajim nautilus-burn pidgin removable-devices upnp"
+allowed_plugins="bluetooth evolution gajim nautilus-burn pidgin removable-devices upnp"
 
 plugin_error_or_ignore()
 {
@@ -141,14 +137,6 @@ for plugin in ${used_plugins}; do
 				add_plugin="0"
 			fi
 		;;
-		empathy)
-			PKG_CHECK_MODULES(EMPATHY, libempathy >= $EMPATHY_REQUIRED libempathy-gtk >= $EMPATHY_GTK_REQUIRED libempathy-gtk <= 2.29.1 gio-2.0 telepathy-glib,
-					  enable_empathy=yes, enable_empathy=no)
-			if test "${enable_empathy}" != "yes" ; then
-				plugin_error_or_ignore "you need libempathy and libempathy-gtk to build the Empathy plugin"
-				add_plugin="0"
-			fi
-		;;
 		evolution)
 			PKG_CHECK_MODULES(NST_EBOOK, libebook-1.2 >= $EBOOK_REQUIRED,
 					   enable_evolution=yes, enable_evolution=no)
@@ -269,7 +257,6 @@ src/Makefile
 src/nautilus-sendto.pc
 src/plugins/Makefile
 src/plugins/bluetooth/Makefile
-src/plugins/empathy/Makefile
 src/plugins/evolution/Makefile
 src/plugins/gajim/Makefile
 src/plugins/nautilus-burn/Makefile
diff --git a/src/plugins/empathy/Makefile.am b/src/plugins/empathy/Makefile.am
deleted file mode 100644
index 4e787d1..0000000
--- a/src/plugins/empathy/Makefile.am
+++ b/dev/null
@@ -1,19 +0,0 @@
-plugindir = $(libdir)/nautilus-sendto/plugins
-
-INCLUDES =                                      \
-        -DDATADIR=\"$(datadir)\"                \
-        -DICONDIR=\"$(icondir)\"                \
-	-DLOCALEDIR="\"$(datadir)/locale\""	\
-        -I$(top_srcdir)/src                     \
-        -I$(top_builddir)                       \
-        $(NAUTILUS_SENDTO_CFLAGS)               \
-	$(WARN_CFLAGS)				\
-	$(DISABLE_DEPRECATED)			\
-	$(EMPATHY_CFLAGS)
-
-plugin_LTLIBRARIES = libnstempathy.la
-
-libnstempathy_la_SOURCES = empathy.c
-libnstempathy_la_LDFLAGS = -module -avoid-version
-libnstempathy_la_LIBADD = $(EMPATHY_LIBS) $(NAUTILUS_SENDTO_LIBS)
-
diff --git a/src/plugins/empathy/empathy.c b/src/plugins/empathy/empathy.c
deleted file mode 100644
index f84f789..0000000
--- a/src/plugins/empathy/empathy.c
+++ b/dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (C) 2008, 2009 Collabora Ltd.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * General Public License for more av.
- *
- * You should have received a copy of the GNU General Public
- * License along with this program; if not, write to the
- * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301  USA.
- *
- * Authors: Jonny Lamb <jonny.lamb@collabora.co.uk>
- *          Cosimo Cecchi <cosimo.cecchi@collabora.co.uk>
- */
-
-#include "config.h"
-
-#include <glib.h>
-#include <glib/gi18n-lib.h>
-#include <gtk/gtk.h>
-#include <gio/gio.h>
-
-#include <telepathy-glib/enums.h>
-
-#include <libempathy/empathy-contact.h>
-#include <libempathy/empathy-debug.h>
-#include <libempathy/empathy-contact-manager.h>
-#include <libempathy/empathy-ft-factory.h>
-#include <libempathy/empathy-ft-handler.h>
-#include <libempathy/empathy-tp-file.h>
-#include <libempathy/empathy-account-manager.h>
-
-#include <libempathy-gtk/empathy-contact-selector.h>
-#include <libempathy-gtk/empathy-ui-utils.h>
-
-#include "nautilus-sendto-plugin.h"
-
-static EmpathyAccountManager *acc_manager = NULL;
-static EmpathyFTFactory *factory = NULL;
-static guint transfers = 0;
-
-static gboolean destroy (NstPlugin *plugin);
-
-static void
-handle_account_manager_ready ()
-{
-  TpConnectionPresenceType presence;
-
-  presence = empathy_account_manager_get_global_presence (acc_manager,
-      NULL, NULL);
-
-  if (presence < TP_CONNECTION_PRESENCE_TYPE_AVAILABLE)
-    return;
-}
-
-static void
-acc_manager_ready_cb (EmpathyAccountManager *am,
-    GParamSpec *pspec,
-    gpointer _user_data)
-{
-  if (!empathy_account_manager_is_ready (am))
-    return;
-
-  handle_account_manager_ready ();
-}
-
-static gboolean
-init (NstPlugin *plugin)
-{
-  g_print ("Init %s plugin\n", plugin->info->id);
-
-  bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
-  bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-
-  empathy_gtk_init ();
-
-  acc_manager = empathy_account_manager_dup_singleton ();
-
-  if (empathy_account_manager_is_ready (acc_manager))
-    handle_account_manager_ready ();
-  else
-    g_signal_connect (acc_manager, "notify::ready",
-        G_CALLBACK (acc_manager_ready_cb), NULL);
-
-  return TRUE;
-}
-
-static GtkWidget *
-get_contacts_widget (NstPlugin *plugin)
-{
-  EmpathyContactManager *manager;
-  GtkWidget *selector;
-
-  manager = empathy_contact_manager_dup_singleton ();
-  selector = empathy_contact_selector_new (EMPATHY_CONTACT_LIST (manager));
-
-  empathy_contact_selector_set_visible (EMPATHY_CONTACT_SELECTOR (selector),
-      (EmpathyContactSelectorFilterFunc) empathy_contact_can_send_files, NULL);
-
-  g_object_unref (manager);
-
-  return selector;
-}
-
-static EmpathyContact *
-get_selected_contact (GtkWidget *contact_widget)
-{
-  EmpathyContact *contact;
-  GtkTreeModel *model;
-  GtkTreeIter iter;
-
-  if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (contact_widget), &iter))
-    return NULL;
-
-  model = gtk_combo_box_get_model (GTK_COMBO_BOX (contact_widget));
-  gtk_tree_model_get (model, &iter,
-      EMPATHY_CONTACT_LIST_STORE_COL_CONTACT, &contact, -1);
-
-  return contact;
-}
-
-static gboolean
-validate_destination (NstPlugin *plugin,
-                      GtkWidget *contact_widget,
-                      gchar **error)
-{
-  EmpathyContact *contact = NULL;
-  gboolean ret = TRUE;
-
-  contact = get_selected_contact (contact_widget);
-
-  if (!contact)
-    return FALSE;
-
-  if (!empathy_contact_can_send_files (contact))
-    {
-      *error = g_strdup (_("The contact selected cannot receive files."));
-      ret = FALSE;
-    }
-
-  if (ret && !empathy_contact_is_online (contact))
-    {
-      *error = g_strdup (_("The contact selected is offline."));
-      ret = FALSE;
-    }
-
-  g_object_unref (contact);
-
-  return ret;
-}
-
-static void
-quit (void)
-{
-  if (--transfers > 0)
-    return;
-
-  destroy (NULL);
-  gtk_main_quit ();
-}
-
-static void
-transfer_done_cb (EmpathyFTHandler *handler,
-                  EmpathyTpFile *tp_file,
-                  NstPlugin *plugin)
-{
-  quit ();  
-}
-
-static void
-transfer_error_cb (EmpathyFTHandler *handler,
-                   GError *error,
-                   NstPlugin *plugin)
-{
-  quit ();
-}
-
-static void
-error_dialog_cb (GtkDialog *dialog,
-                 gint arg,
-                 gpointer user_data)
-{
-  gtk_widget_destroy (GTK_WIDGET (dialog));
-  quit ();
-}
-
-static void
-handler_ready_cb (EmpathyFTFactory *factory,
-                  EmpathyFTHandler *handler,
-                  GError *error,
-                  NstPlugin *plugin)
-{
-  if (error != NULL)
-    {
-      GtkWidget *dialog;
-      dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR,
-          GTK_BUTTONS_CLOSE, "%s",
-          error->message ? error->message : _("No error message"));
-
-      g_signal_connect (dialog, "response", G_CALLBACK (error_dialog_cb), NULL);
-      gtk_widget_show (dialog);
-    }
-  else
-    {
-      g_signal_connect (handler, "transfer-done",
-          G_CALLBACK (transfer_done_cb), plugin);
-      g_signal_connect (handler, "transfer-error",
-          G_CALLBACK (transfer_error_cb), plugin);
-
-      empathy_ft_handler_start_transfer (handler);
-    }
-}
-
-static gboolean
-send_files (NstPlugin *plugin,
-            GtkWidget *contact_widget,
-            GList *file_list)
-{
-  EmpathyContact *contact;
-  GList *l;
-
-  contact = get_selected_contact (contact_widget);
-
-  if (!contact)
-    return FALSE;
-
-  factory = empathy_ft_factory_dup_singleton ();
-
-  g_signal_connect (factory, "new-ft-handler",
-      G_CALLBACK (handler_ready_cb), plugin);
-
-  for (l = file_list; l; l = l->next)
-    {
-      gchar *path = l->data;
-      GFile *file;
-
-      file = g_file_new_for_uri (path);
-
-      ++transfers;
-
-      empathy_ft_factory_new_transfer_outgoing (factory,
-          contact, file);
-
-      g_object_unref (file);
-    }
-
-  g_object_unref (contact);
-
-  if (transfers == 0)
-    {
-      destroy (NULL);
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
-static gboolean
-destroy (NstPlugin *plugin)
-{
-  if (acc_manager)
-    g_object_unref (acc_manager);
-
-  if (factory)
-    g_object_unref (factory);
-
-  return TRUE;
-}
-
-static
-NstPluginInfo plugin_info = {
-  "im",
-  "empathy",
-  N_("Instant Message (Empathy)"),
-  NULL,
-  TRUE,
-  NAUTILUS_CAPS_NONE,
-  init,
-  get_contacts_widget,
-  validate_destination,
-  send_files,
-  destroy
-};
-
-NST_INIT_PLUGIN (plugin_info)
-
--
cgit v0.8.3.1