aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-main-window.c
diff options
context:
space:
mode:
authorJonny Lamb <jonnylamb@gnome.org>2010-03-12 10:22:47 +0800
committerJonny Lamb <jonnylamb@gnome.org>2010-03-13 00:47:09 +0800
commitc448b89bb4f18377818b7802f4cb66ba47e3fe04 (patch)
tree5e87eee375c0e4886d906c0b82c710774c41bd10 /src/empathy-main-window.c
parent2d9cbe355d22570bbc32d2cde0d7942adab355e0 (diff)
downloadgsoc2013-empathy-c448b89bb4f18377818b7802f4cb66ba47e3fe04.tar
gsoc2013-empathy-c448b89bb4f18377818b7802f4cb66ba47e3fe04.tar.gz
gsoc2013-empathy-c448b89bb4f18377818b7802f4cb66ba47e3fe04.tar.bz2
gsoc2013-empathy-c448b89bb4f18377818b7802f4cb66ba47e3fe04.tar.lz
gsoc2013-empathy-c448b89bb4f18377818b7802f4cb66ba47e3fe04.tar.xz
gsoc2013-empathy-c448b89bb4f18377818b7802f4cb66ba47e3fe04.tar.zst
gsoc2013-empathy-c448b89bb4f18377818b7802f4cb66ba47e3fe04.zip
Migrate butterfly logs to remove the network ID suffix.
Bug #612519 contains much more information about this change. Signed-off-by: Jonny Lamb <jonnylamb@gnome.org>
Diffstat (limited to 'src/empathy-main-window.c')
-rw-r--r--src/empathy-main-window.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 240f4b18b..84331e7bd 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -63,6 +63,7 @@
#include "empathy-chatrooms-window.h"
#include "empathy-event-manager.h"
#include "empathy-ft-manager.h"
+#include "empathy-migrate-butterfly-logs.h"
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
#include <libempathy/empathy-debug.h>
@@ -119,6 +120,9 @@ typedef struct {
/* Actions that are enabled when there are connected accounts */
GList *actions_connected;
+
+ /* The idle event source to migrate butterfly's logs */
+ guint butterfly_log_migration_contact_added_id;
} EmpathyMainWindow;
static EmpathyMainWindow *main_window = NULL;
@@ -1243,6 +1247,18 @@ account_manager_prepared_cb (GObject *source_object,
g_list_free (accounts);
}
+static void
+main_window_contact_added_cb (EmpathyContactMonitor *monitor,
+ EmpathyContact *contact,
+ EmpathyMainWindow *window)
+{
+ if (!empathy_migrate_butterfly_logs (contact)) {
+ g_signal_handler_disconnect (monitor,
+ window->butterfly_log_migration_contact_added_id);
+ window->butterfly_log_migration_contact_added_id = 0;
+ }
+}
+
GtkWidget *
empathy_main_window_show (void)
{
@@ -1391,6 +1407,8 @@ empathy_main_window_show (void)
EMPATHY_CONTACT_FEATURE_ALL);
g_signal_connect (monitor, "contact-presence-changed",
G_CALLBACK (main_window_contact_presence_changed_cb), window);
+ window->butterfly_log_migration_contact_added_id = g_signal_connect (monitor, "contact-added",
+ G_CALLBACK (main_window_contact_added_cb), window);
g_object_unref (list_iface);
gtk_widget_show (GTK_WIDGET (window->list_view));