aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-private-chat.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2007-08-31 00:49:52 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-08-31 00:49:52 +0800
commit0b0bb0f621d8e1cda1508d9062a279459fc3b955 (patch)
tree03ad0e8b2180f5e3d6821fbab6315b33c7baf4d8 /libempathy-gtk/empathy-private-chat.c
parent3a535643a694d0dd1bed8e0b7a2fd6fd21e6ee0c (diff)
downloadgsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.gz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.bz2
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.lz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.xz
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.tar.zst
gsoc2013-empathy-0b0bb0f621d8e1cda1508d9062a279459fc3b955.zip
Completely reworked ContactList API. Fixes bug #471611, bug #467280, bug #459540 and bug #462907.
svn path=/trunk/; revision=280
Diffstat (limited to 'libempathy-gtk/empathy-private-chat.c')
-rw-r--r--libempathy-gtk/empathy-private-chat.c40
1 files changed, 23 insertions, 17 deletions
diff --git a/libempathy-gtk/empathy-private-chat.c b/libempathy-gtk/empathy-private-chat.c
index 81f93c021..b187e98cd 100644
--- a/libempathy-gtk/empathy-private-chat.c
+++ b/libempathy-gtk/empathy-private-chat.c
@@ -36,7 +36,7 @@
#include <libempathy/empathy-debug.h>
#include <libempathy/empathy-tp-chat.h>
#include <libempathy/empathy-tp-contact-list.h>
-#include <libempathy/empathy-contact-manager.h>
+#include <libempathy/empathy-contact-factory.h>
#include "empathy-private-chat.h"
#include "empathy-chat-view.h"
@@ -51,11 +51,12 @@
#define GET_PRIV(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), EMPATHY_TYPE_PRIVATE_CHAT, EmpathyPrivateChatPriv))
struct _EmpathyPrivateChatPriv {
- EmpathyContact *contact;
- gchar *name;
- gboolean is_online;
- GtkWidget *widget;
- GtkWidget *text_view_sw;
+ EmpathyContactFactory *factory;
+ EmpathyContact *contact;
+ gchar *name;
+ gboolean is_online;
+ GtkWidget *widget;
+ GtkWidget *text_view_sw;
};
static void empathy_private_chat_class_init (EmpathyPrivateChatClass *klass);
@@ -125,7 +126,9 @@ private_chat_finalize (GObject *object)
if (priv->contact) {
g_object_unref (priv->contact);
}
-
+ if (priv->factory) {
+ g_object_unref (priv->factory);
+ }
g_free (priv->name);
G_OBJECT_CLASS (empathy_private_chat_parent_class)->finalize (object);
@@ -327,27 +330,30 @@ EmpathyPrivateChat *
empathy_private_chat_new (McAccount *account,
TpChan *tp_chan)
{
- EmpathyPrivateChat *chat;
- EmpathyTpChat *tp_chat;
- EmpathyContactManager *manager;
- EmpathyTpContactList *list;
- EmpathyContact *contact;
+ EmpathyPrivateChat *chat;
+ EmpathyPrivateChatPriv *priv;
+ EmpathyTpChat *tp_chat;
+ EmpathyContactFactory *factory;
+ EmpathyContact *contact;
g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
g_return_val_if_fail (TELEPATHY_IS_CHAN (tp_chan), NULL);
- manager = empathy_contact_manager_new ();
- list = empathy_contact_manager_get_list (manager, account);
- contact = empathy_tp_contact_list_get_from_handle (list, tp_chan->handle);
+ factory = empathy_contact_factory_new ();
+ contact = empathy_contact_factory_get_from_handle (factory,
+ account,
+ tp_chan->handle);
chat = g_object_new (EMPATHY_TYPE_PRIVATE_CHAT, NULL);
- tp_chat = empathy_tp_chat_new (account, tp_chan);
+ priv = GET_PRIV (chat);
+ priv->factory = factory;
+ tp_chat = empathy_tp_chat_new (account, tp_chan);
private_chat_setup (chat, contact, tp_chat);
g_object_unref (tp_chat);
g_object_unref (contact);
- g_object_unref (manager);
+ g_object_unref (factory);
return chat;
}