aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-tp-contact-list.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-05-21 06:34:10 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-05-21 06:34:10 +0800
commite9da37418519e89f8489491310b5f3ca3ef59f76 (patch)
tree1c071ef8c6bbbd3922dc5d70888bd30074313d1c /libempathy/empathy-tp-contact-list.c
parent03d20e55433ca5d11633dec62435ea66ebdaf1ae (diff)
downloadgsoc2013-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/empathy-tp-contact-list.c')
-rw-r--r--libempathy/empathy-tp-contact-list.c46
1 files changed, 18 insertions, 28 deletions
diff --git a/libempathy/empathy-tp-contact-list.c b/libempathy/empathy-tp-contact-list.c
index 60a7fd535..2ebb648a3 100644
--- a/libempathy/empathy-tp-contact-list.c
+++ b/libempathy/empathy-tp-contact-list.c
@@ -622,6 +622,11 @@ empathy_tp_contact_list_get_from_handles (EmpathyTpContactList *list,
guint handle;
handle = g_array_index (handles, guint, i);
+
+ if (handle == 0) {
+ continue;
+ }
+
contact = g_hash_table_lookup (priv->contacts,
GUINT_TO_POINTER (handle));
@@ -974,49 +979,34 @@ tp_contact_list_newchannel_cb (DBusGProxy *proxy,
g_array_free (members, TRUE);
}
if (list_type == TP_CONTACT_LIST_TYPE_PUBLISH) {
- GPtrArray *info;
- GArray *pending;
- guint i;
+ GList *members, *l;
+ GArray *pending;
g_signal_connect (group, "local-pending",
G_CALLBACK (tp_contact_list_local_pending_cb),
list);
- info = gossip_telepathy_group_get_local_pending_members_with_info (group);
-
- if (!info) {
- /* This happens with butterfly because
- * GetLocalPendingMembersWithInfo is not
- * implemented */
+ members = gossip_telepathy_group_get_local_pending_members_with_info (group);
+ if (!members) {
g_object_unref (new_chan);
return;
}
pending = g_array_sized_new (FALSE, FALSE, sizeof (guint), 1);
- for (i = 0; info->len > i; i++) {
- GValueArray *pending_struct;
- guint member;
- guint invitor;
- guint reason;
- const gchar *message;
-
- pending_struct = g_ptr_array_index (info, i);
- member = g_value_get_uint (g_value_array_get_nth (pending_struct, 0));
- invitor = g_value_get_uint (g_value_array_get_nth (pending_struct, 1));
- reason = g_value_get_uint (g_value_array_get_nth (pending_struct, 2));
- message = g_value_get_string (g_value_array_get_nth (pending_struct, 3));
+ for (l = members; l; l = l->next) {
+ GossipTpGroupInfo *info;
- g_array_insert_val (pending, 0, member);
+ info = l->data;
+ g_array_insert_val (pending, 0, info->member);
tp_contact_list_local_pending_cb (group, pending,
- invitor,
- reason,
- message, list);
-
- g_value_array_free (pending_struct);
+ info->actor,
+ info->reason,
+ info->message,
+ list);
}
- g_ptr_array_free (info, TRUE);
+ gossip_telepathy_group_info_list_free (members);
g_array_free (pending, TRUE);
}
}