diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-12-03 23:12:05 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-12-03 23:12:05 +0800 |
commit | de24c820d141079b880de18e3ff6c28955588732 (patch) | |
tree | e74bf299ff2fde4a7fce370a2714b90b4b9389cd /libempathy/empathy-tp-chat.c | |
parent | 1fe7346f60e911fa37a22361c34efc6baa946bf8 (diff) | |
download | gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.gz gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.bz2 gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.lz gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.xz gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.tar.zst gsoc2013-empathy-de24c820d141079b880de18e3ff6c28955588732.zip |
Cleanup chat objects API and request a new Text channel if account gets
2007-12-03 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/empathy-chat-window.c:
* libempathy-gtk/empathy-chat.c:
* libempathy-gtk/empathy-chat.h:
* libempathy-gtk/empathy-group-chat.c:
* libempathy-gtk/empathy-group-chat.h:
* libempathy-gtk/empathy-private-chat.c:
* libempathy-gtk/empathy-private-chat.h:
* libempathy/empathy-tp-chat.c:
* libempathy/empathy-tp-chat.h:
* python/pyempathy/pyempathy.defs:
* python/pyempathygtk/pyempathygtk.defs:
* src/empathy-chat-chandler.c: Cleanup chat objects API and request a
new Text channel if account gets reconnected.
svn path=/trunk/; revision=461
Diffstat (limited to 'libempathy/empathy-tp-chat.c')
-rw-r--r-- | libempathy/empathy-tp-chat.c | 55 |
1 files changed, 12 insertions, 43 deletions
diff --git a/libempathy/empathy-tp-chat.c b/libempathy/empathy-tp-chat.c index 6a871822e..68a0af174 100644 --- a/libempathy/empathy-tp-chat.c +++ b/libempathy/empathy-tp-chat.c @@ -561,49 +561,6 @@ empathy_tp_chat_new (McAccount *account, NULL); } -EmpathyTpChat * -empathy_tp_chat_new_with_contact (EmpathyContact *contact) -{ - EmpathyTpChat *chat; - MissionControl *mc; - McAccount *account; - TpConn *tp_conn; - TpChan *text_chan; - const gchar *bus_name; - guint handle; - - g_return_val_if_fail (EMPATHY_IS_CONTACT (contact), NULL); - - mc = empathy_mission_control_new (); - account = empathy_contact_get_account (contact); - - if (mission_control_get_connection_status (mc, account, NULL) != 0) { - /* The account is not connected, nothing to do. */ - return NULL; - } - - tp_conn = mission_control_get_connection (mc, account, NULL); - g_return_val_if_fail (tp_conn != NULL, NULL); - bus_name = dbus_g_proxy_get_bus_name (DBUS_G_PROXY (tp_conn)); - handle = empathy_contact_get_handle (contact); - - text_chan = tp_conn_new_channel (tp_get_bus (), - tp_conn, - bus_name, - TP_IFACE_CHANNEL_TYPE_TEXT, - TP_HANDLE_TYPE_CONTACT, - handle, - TRUE); - - chat = empathy_tp_chat_new (account, text_chan); - - g_object_unref (tp_conn); - g_object_unref (text_chan); - g_object_unref (mc); - - return chat; -} - gboolean empathy_tp_chat_get_acknowledge (EmpathyTpChat *chat) { @@ -642,6 +599,18 @@ empathy_tp_chat_get_channel (EmpathyTpChat *chat) return priv->tp_chan; } +McAccount * +empathy_tp_chat_get_account (EmpathyTpChat *chat) +{ + EmpathyTpChatPriv *priv; + + g_return_val_if_fail (EMPATHY_IS_TP_CHAT (chat), NULL); + + priv = GET_PRIV (chat); + + return priv->account; +} + GList * empathy_tp_chat_get_pendings (EmpathyTpChat *chat) { |