diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2007-05-21 06:34:10 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@src.gnome.org> | 2007-05-21 06:34:10 +0800 |
commit | e9da37418519e89f8489491310b5f3ca3ef59f76 (patch) | |
tree | 1c071ef8c6bbbd3922dc5d70888bd30074313d1c /libempathy-gtk/gossip-private-chat.c | |
parent | 03d20e55433ca5d11633dec62435ea66ebdaf1ae (diff) | |
download | gsoc2013-empathy-e9da37418519e89f8489491310b5f3ca3ef59f76.tar gsoc2013-empathy-e9da37418519e89f8489491310b5f3ca3ef59f76.tar.gz gsoc2013-empathy-e9da37418519e89f8489491310b5f3ca3ef59f76.tar.bz2 gsoc2013-empathy-e9da37418519e89f8489491310b5f3ca3ef59f76.tar.lz gsoc2013-empathy-e9da37418519e89f8489491310b5f3ca3ef59f76.tar.xz gsoc2013-empathy-e9da37418519e89f8489491310b5f3ca3ef59f76.tar.zst gsoc2013-empathy-e9da37418519e89f8489491310b5f3ca3ef59f76.zip |
Implementing basic chatroom support. Actually it works only if we get
2007-05-21 Xavier Claessens <xclaesse@gmail.com>
* libempathy-gtk/gossip-group-chat.c:
* libempathy-gtk/gossip-group-chat.h:
* libempathy-gtk/gossip-private-chat.c:
* libempathy-gtk/gossip-private-chat.h:
* libempathy-gtk/gossip-group-chat.glade:
* libempathy-gtk/Makefile.am:
* src/empathy-chat-main.c:
* libempathy/empathy-tp-contact-list.c:
* libempathy/gossip-telepathy-group.c:
* libempathy/gossip-telepathy-group.h:
* libempathy/empathy-tp-chatroom.c:
* libempathy/empathy-tp-chatroom.h: Implementing basic chatroom support.
Actually it works only if we get invited in a chatroom.
svn path=/trunk/; revision=87
Diffstat (limited to 'libempathy-gtk/gossip-private-chat.c')
-rw-r--r-- | libempathy-gtk/gossip-private-chat.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/libempathy-gtk/gossip-private-chat.c b/libempathy-gtk/gossip-private-chat.c index 84cc156e8..fb7198ff0 100644 --- a/libempathy-gtk/gossip-private-chat.c +++ b/libempathy-gtk/gossip-private-chat.c @@ -33,10 +33,10 @@ #include <glade/glade.h> #include <glib/gi18n.h> -#include <libmissioncontrol/mc-account.h> - #include <libempathy/gossip-debug.h> #include <libempathy/empathy-tp-chat.h> +#include <libempathy/empathy-tp-contact-list.h> +#include <libempathy/empathy-contact-manager.h> //#include <libgossip/gossip-log.h> #include "gossip-private-chat.h" @@ -328,36 +328,44 @@ private_chat_setup (GossipPrivateChat *chat, } GossipPrivateChat * -gossip_private_chat_new (GossipContact *contact) +gossip_private_chat_new (McAccount *account, + TpChan *tp_chan) { - GossipPrivateChat *chat; - EmpathyTpChat *tp_chat; + GossipPrivateChat *chat; + EmpathyTpChat *tp_chat; + EmpathyContactManager *manager; + EmpathyTpContactList *list; + GossipContact *contact; - g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL); + 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); chat = g_object_new (GOSSIP_TYPE_PRIVATE_CHAT, NULL); - tp_chat = empathy_tp_chat_new_with_contact (contact); + 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); return chat; } GossipPrivateChat * -gossip_private_chat_new_with_channel (GossipContact *contact, - TpChan *tp_chan) +gossip_private_chat_new_with_contact (GossipContact *contact) { GossipPrivateChat *chat; EmpathyTpChat *tp_chat; - McAccount *account; g_return_val_if_fail (GOSSIP_IS_CONTACT (contact), NULL); - g_return_val_if_fail (TELEPATHY_IS_CHAN (tp_chan), NULL); - account = gossip_contact_get_account (contact); chat = g_object_new (GOSSIP_TYPE_PRIVATE_CHAT, NULL); - tp_chat = empathy_tp_chat_new (account, tp_chan); + tp_chat = empathy_tp_chat_new_with_contact (contact); private_chat_setup (chat, contact, tp_chat); g_object_unref (tp_chat); |