aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-private-chat.c
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2007-08-31 00:49:52 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2007-08-31 00:49:52 +0800
commitf572bfd5fa085c368695f45512ca9c55df4fb513 (patch)
tree03ad0e8b2180f5e3d6821fbab6315b33c7baf4d8 /libempathy-gtk/empathy-private-chat.c
parentb409e047e61e73851a162bb9a903b012469c0ac9 (diff)
downloadgsoc2013-empathy-f572bfd5fa085c368695f45512ca9c55df4fb513.tar
gsoc2013-empathy-f572bfd5fa085c368695f45512ca9c55df4fb513.tar.gz
gsoc2013-empathy-f572bfd5fa085c368695f45512ca9c55df4fb513.tar.bz2
gsoc2013-empathy-f572bfd5fa085c368695f45512ca9c55df4fb513.tar.lz
gsoc2013-empathy-f572bfd5fa085c368695f45512ca9c55df4fb513.tar.xz
gsoc2013-empathy-f572bfd5fa085c368695f45512ca9c55df4fb513.tar.zst
gsoc2013-empathy-f572bfd5fa085c368695f45512ca9c55df4fb513.zip
Completely reworked ContactList API. Fixes bug #471611, bug #467280, bug #459540 and bug #462907.
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@280 4ee84921-47dd-4033-b63a-18d7a039a3e4
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;
}