[empathy] all: remove butterfly workarounds (bgo#612555)



commit 38e4f668b25cefbdc161f9c17f61a904c67c0c79
Author: Jonny Lamb <jonnylamb gnome org>
Date:   Wed Sep 22 00:14:16 2010 +0100

    all: remove butterfly workarounds (bgo#612555)
    
    Signed-off-by: Jonny Lamb <jonnylamb gnome org>

 libempathy/empathy-tp-chat.c         |   64 ---------
 src/Makefile.am                      |    1 -
 src/empathy-chat-window.c            |    3 +-
 src/empathy-main-window.c            |   29 ----
 src/empathy-migrate-butterfly-logs.c |  234 ----------------------------------
 src/empathy-migrate-butterfly-logs.h |   32 -----
 6 files changed, 1 insertions(+), 362 deletions(-)
---
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c
index 9eaff95..11a6e7d 100644
--- a/libempathy/empathy-tp-chat.c
+++ b/libempathy/empathy-tp-chat.c
@@ -890,66 +890,6 @@ check_almost_ready (EmpathyTpChat *self)
 }
 
 static void
-tp_chat_update_remote_contact (EmpathyTpChat *self)
-{
-	TpChannel *channel = (TpChannel *) self;
-	EmpathyContact *contact = NULL;
-	TpHandle self_handle;
-	TpHandleType handle_type;
-	GList *l;
-
-	/* If this is a named chatroom, never pretend it is a private chat */
-	tp_channel_get_handle (channel, &handle_type);
-	if (handle_type == TP_HANDLE_TYPE_ROOM) {
-		return;
-	}
-
-	/* This is an MSN chat, but it's the new style where 1-1 chats don't
-	 * have the group interface. If it has the conference interface, then
-	 * it is indeed a MUC. */
-	if (tp_proxy_has_interface_by_id (self,
-					  TP_IFACE_QUARK_CHANNEL_INTERFACE_CONFERENCE)) {
-		return;
-	}
-
-	/* This is an MSN-like chat where anyone can join the chat at anytime.
-	 * If there is only one non-self contact member, we are in a private
-	 * chat and we set the "remote-contact" property to that contact. If
-	 * there are more, set the "remote-contact" property to NULL and the
-	 * UI will display a contact list. */
-	self_handle = tp_channel_group_get_self_handle (channel);
-	for (l = self->priv->members; l; l = l->next) {
-		/* Skip self contact if member */
-		if (empathy_contact_get_handle (l->data) == self_handle) {
-			continue;
-		}
-
-		/* We have more than one remote contact, break */
-		if (contact != NULL) {
-			contact = NULL;
-			break;
-		}
-
-		/* If we didn't find yet a remote contact, keep this one */
-		contact = l->data;
-	}
-
-	if (self->priv->remote_contact == contact) {
-		return;
-	}
-
-	DEBUG ("Changing remote contact from %p to %p",
-		self->priv->remote_contact, contact);
-
-	if (self->priv->remote_contact) {
-		g_object_unref (self->priv->remote_contact);
-	}
-
-	self->priv->remote_contact = contact ? g_object_ref (contact) : NULL;
-	g_object_notify (G_OBJECT (self), "remote-contact");
-}
-
-static void
 tp_chat_got_added_contacts_cb (TpConnection            *connection,
 			       guint                    n_contacts,
 			       EmpathyContact * const * contacts,
@@ -984,7 +924,6 @@ tp_chat_got_added_contacts_cb (TpConnection            *connection,
 		}
 	}
 
-	tp_chat_update_remote_contact (EMPATHY_TP_CHAT (chat));
 	check_almost_ready (EMPATHY_TP_CHAT (chat));
 }
 
@@ -1092,7 +1031,6 @@ tp_chat_got_renamed_contacts_cb (TpConnection            *connection,
 		self->priv->user = g_object_ref (new);
 	}
 
-	tp_chat_update_remote_contact (self);
 	check_almost_ready (self);
 }
 
@@ -1168,8 +1106,6 @@ tp_chat_group_members_changed_cb (TpChannel     *channel,
 			G_OBJECT (self));
 	}
 
-	tp_chat_update_remote_contact (self);
-
 	if (actor_contact != NULL) {
 		g_object_unref (actor_contact);
 	}
diff --git a/src/Makefile.am b/src/Makefile.am
index 40be88c..ef4e8d9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -176,7 +176,6 @@ empathy_handwritten_source = \
 	empathy-ft-manager.c empathy-ft-manager.h			\
 	empathy-invite-participant-dialog.c empathy-invite-participant-dialog.h \
 	empathy-main-window.c empathy-main-window.h			\
-	empathy-migrate-butterfly-logs.c empathy-migrate-butterfly-logs.h \
 	empathy-new-chatroom-dialog.c empathy-new-chatroom-dialog.h	\
 	empathy-notifications-approver.c empathy-notifications-approver.h \
 	empathy-call-observer.c empathy-call-observer.h			\
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 97ed1b9..44f3dcc 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -1482,8 +1482,7 @@ chat_window_new_message_cb (EmpathyChat       *chat,
 	 *   a) the chatroom's always_urgent property is TRUE
 	 *   b) the message contains our alias
 	 */
-	if (empathy_chat_is_room (chat) ||
-	    empathy_chat_get_remote_contact (chat) == NULL) {
+	if (empathy_chat_is_room (chat)) {
 		TpAccount             *account;
 		const gchar           *room;
 		EmpathyChatroom       *chatroom;
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 3f87c4f..cb135c4 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -76,7 +76,6 @@
 #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>
@@ -169,9 +168,6 @@ struct _EmpathyMainWindowPriv {
 	/* 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_members_changed_id;
-
 	gboolean               shell_running;
 };
 
@@ -2051,27 +2047,6 @@ account_manager_prepared_cb (GObject      *source_object,
 	g_list_free (accounts);
 }
 
-static void
-main_window_members_changed_cb (EmpathyContactList *list,
-				EmpathyContact     *contact,
-				EmpathyContact     *actor,
-				guint               reason,
-				gchar              *message,
-				gboolean            is_member,
-				EmpathyMainWindow  *window)
-{
-	EmpathyMainWindowPriv *priv = GET_PRIV (window);
-
-	if (!is_member)
-		return;
-
-	if (!empathy_migrate_butterfly_logs (contact)) {
-		g_signal_handler_disconnect (list,
-			priv->butterfly_log_migration_members_changed_id);
-		priv->butterfly_log_migration_members_changed_id = 0;
-	}
-}
-
 void
 empathy_main_window_set_shell_running (EmpathyMainWindow *window,
                                        gboolean          shell_running)
@@ -2358,10 +2333,6 @@ empathy_main_window_init (EmpathyMainWindow *window)
 			EMPATHY_INDIVIDUAL_VIEW_FEATURE_ALL ^ EMPATHY_INDIVIDUAL_VIEW_FEATURE_PERSONA_DROP,
 			EMPATHY_INDIVIDUAL_FEATURE_ALL);
 
-	priv->butterfly_log_migration_members_changed_id = g_signal_connect (
-			priv->contact_manager, "members-changed",
-			G_CALLBACK (main_window_members_changed_cb), window);
-
 	gtk_widget_show (GTK_WIDGET (priv->individual_view));
 	gtk_container_add (GTK_CONTAINER (sw),
 			   GTK_WIDGET (priv->individual_view));



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]