aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/gossip-telepathy-group.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/gossip-telepathy-group.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/gossip-telepathy-group.c')
-rw-r--r--libempathy/gossip-telepathy-group.c57
1 files changed, 52 insertions, 5 deletions
diff --git a/libempathy/gossip-telepathy-group.c b/libempathy/gossip-telepathy-group.c
index 3f9998c0d..5d6bff670 100644
--- a/libempathy/gossip-telepathy-group.c
+++ b/libempathy/gossip-telepathy-group.c
@@ -314,11 +314,13 @@ gossip_telepathy_group_get_all_members (GossipTelepathyGroup *group,
}
}
-GPtrArray *
-gossip_telepathy_group_get_local_pending_members_with_info (GossipTelepathyGroup *group)
+GList *
+gossip_telepathy_group_get_local_pending_members_with_info (GossipTelepathyGroup *group)
{
GossipTelepathyGroupPriv *priv;
- GPtrArray *info = NULL;
+ GPtrArray *array;
+ guint i;
+ GList *infos = NULL;
GError *error = NULL;
g_return_val_if_fail (GOSSIP_IS_TELEPATHY_GROUP (group), NULL);
@@ -326,17 +328,62 @@ gossip_telepathy_group_get_local_pending_members_with_info (GossipTelepathyGroup
priv = GET_PRIV (group);
if (!tp_chan_iface_group_get_local_pending_members_with_info (priv->group_iface,
- &info,
+ &array,
&error)) {
gossip_debug (DEBUG_DOMAIN,
"GetLocalPendingMembersWithInfo failed: %s",
error ? error->message : "No error given");
g_clear_error (&error);
+
+ return NULL;
+ }
+
+ if (!array) {
+ /* This happens with butterfly because
+ * GetLocalPendingMembersWithInfo is not
+ * implemented */
+ return NULL;
+ }
+
+ for (i = 0; array->len > i; i++) {
+ GValueArray *pending_struct;
+ GossipTpGroupInfo *info;
+ const gchar *message;
+
+ info = g_slice_new (GossipTpGroupInfo);
+
+ pending_struct = g_ptr_array_index (array, i);
+ info->member = g_value_get_uint (g_value_array_get_nth (pending_struct, 0));
+ info->actor = g_value_get_uint (g_value_array_get_nth (pending_struct, 1));
+ info->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));
+ info->message = g_strdup (message);
+ g_value_array_free (pending_struct);
+
+ infos = g_list_prepend (infos, info);
}
+ g_ptr_array_free (array, TRUE);
- return info;
+ return infos;
}
+void
+gossip_telepathy_group_info_list_free (GList *infos)
+{
+ GList *l;
+
+ for (l = infos; l; l = l->next) {
+ GossipTpGroupInfo *info;
+
+ info = l->data;
+
+ g_free (info->message);
+ g_slice_free (GossipTpGroupInfo, info);
+ }
+ g_list_free (infos);
+}
+
+
static void
telepathy_group_destroy_cb (DBusGProxy *proxy,
GossipTelepathyGroup *group)