#include "empathy-tp-chat.h"
#include "empathy-contact-manager.h"
#include "empathy-contact-list.h"
-#include "empathy-session.h"
#include "empathy-marshal.h"
#include "gossip-debug.h"
#include "gossip-time.h"
#define DEBUG_DOMAIN "TpChat"
struct _EmpathyTpChatPriv {
- EmpathyContactList *list;
- McAccount *account;
- gchar *id;
+ EmpathyContactList *list;
+ EmpathyContactManager *manager;
+ McAccount *account;
+ gchar *id;
+ MissionControl *mc;
- TpChan *tp_chan;
- DBusGProxy *text_iface;
- DBusGProxy *chat_state_iface;
+ TpChan *tp_chan;
+ DBusGProxy *text_iface;
+ DBusGProxy *chat_state_iface;
};
static void empathy_tp_chat_class_init (EmpathyTpChatClass *klass);
g_object_unref (priv->tp_chan);
}
+ if (priv->manager) {
+ g_object_unref (priv->manager);
+ }
if (priv->list) {
g_object_unref (priv->list);
}
if (priv->account) {
g_object_unref (priv->account);
}
+ if (priv->mc) {
+ g_object_unref (priv->mc);
+ }
g_free (priv->id);
G_OBJECT_CLASS (empathy_tp_chat_parent_class)->finalize (object);
{
EmpathyTpChatPriv *priv;
EmpathyTpChat *chat;
- EmpathyContactManager *manager;
g_return_val_if_fail (MC_IS_ACCOUNT (account), NULL);
g_return_val_if_fail (TELEPATHY_IS_CHAN (tp_chan), NULL);
chat = g_object_new (EMPATHY_TYPE_TP_CHAT, NULL);
priv = GET_PRIV (chat);
- manager = empathy_session_get_contact_manager ();
- priv->list = empathy_contact_manager_get_list (manager, account);
+ priv->manager = empathy_contact_manager_new ();
+ priv->list = empathy_contact_manager_get_list (priv->manager, account);
priv->tp_chan = g_object_ref (tp_chan);
priv->account = g_object_ref (account);
+ priv->mc = mission_control_new (tp_get_bus ());
g_object_ref (priv->list);
priv->text_iface = tp_chan_get_interface (tp_chan,
g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL);
- mc = empathy_session_get_mission_control ();
+ mc = mission_control_new (tp_get_bus ());
account = gossip_contact_get_account (contact);
if (mission_control_get_connection_status (mc, account, NULL) != 0) {
g_object_unref (tp_conn);
g_object_unref (text_chan);
+ g_object_unref (mc);
return chat;
}
empathy_tp_chat_get_id (EmpathyTpChat *chat)
{
EmpathyTpChatPriv *priv;
- MissionControl *mc;
TpConn *tp_conn;
GArray *handles;
gchar **names;
return priv->id;
}
- mc = empathy_session_get_mission_control ();
- tp_conn = mission_control_get_connection (mc, priv->account, NULL);
+ tp_conn = mission_control_get_connection (priv->mc, priv->account, NULL);
handles = g_array_new (FALSE, FALSE, sizeof (guint));
g_array_append_val (handles, priv->tp_chan->handle);