soc.2009.telepathy: 661e3019: Close all channels on Client.Handler dis...

sttwister at gmail.com sttwister at gmail.com
Mon Aug 10 08:31:37 EDT 2009


-----------------------------------------------------------------
Revision: 661e3019377ced12ed691701e777b2c0328307aa
Ancestor: 89871def1e2cb38073ed8a2e1765555d3206df29
Author: sttwister at gmail.com
Date: 2009-08-09T21:14:10
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/661e3019377ced12ed691701e777b2c0328307aa

Modified files:
        libpurple/protocols/telepathy/telepathy_channel_text.c
        libpurple/protocols/telepathy/telepathy_client.c

ChangeLog: 

Close all channels on Client.Handler dispose. Got rid of some TODOs and FIXMEs

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy_channel_text.c	fcc547f452bf696741a383e2badad715a16244b9
+++ libpurple/protocols/telepathy/telepathy_channel_text.c	57fb59b88dd6027f960a30ac608683b22de4da1b
@@ -98,8 +98,6 @@ chat_got_message (telepathy_room_channel
 	TpContact *contact = g_hash_table_lookup(
 			tp_channel->contacts, (gpointer)arg_Sender);
 
-	/* TODO: Get rid of the unknown sender bit */
-
 	if (contact != NULL)
 		from = tp_contact_get_alias(contact);
 	else
============================================================
--- libpurple/protocols/telepathy/telepathy_client.c	a265d48dad7ab53177afc32a941b48bb46b8fed6
+++ libpurple/protocols/telepathy/telepathy_client.c	2e45aa2414cdd7a8b891122ecbb7077838623dfb
@@ -42,7 +42,6 @@ typedef struct
 
 typedef struct
 {
-	/* TODO: Fill this in or delete it */
 	  GList *channels;
 
 } TelepathyClientPriv;
@@ -119,11 +118,15 @@ client_dispose (GObject *object)
 static void
 client_dispose (GObject *object)
 {
-	/* TODO: Close all channels */
-	/*
-	TelepathyClientPriv *priv = GET_PRIV (object);
-	*/
+	TelepathyClient *client = TELEPATHY_CLIENT (object);
+	TelepathyClientPriv *priv = client->priv;
+	
+	while (priv->channels)
+	{
+		TpChannel *channel = priv->channels->data;
 
+		tp_cli_channel_call_close(channel, -1, NULL, NULL, NULL, NULL);
+	}
 }
 
 static void
@@ -283,7 +286,7 @@ telepathy_client_class_init (TelepathyCl
 
 	param_spec = g_param_spec_boxed ("channels", "channels",
 		"List of channels we're handling",
-		TELEPATHY_ARRAY_TYPE_OBJECT, // FIXME: What type is this???
+		TELEPATHY_ARRAY_TYPE_OBJECT, 
 		G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
 	g_object_class_install_property (object_class,
 		PROP_CHANNELS, param_spec);
@@ -321,17 +324,13 @@ telepathy_client_handle_channels (TpSvcC
                                   GHashTable *handler_info,
                                   DBusGMethodInvocation *context)
 {
-	/*
 	TelepathyClient *client = TELEPATHY_CLIENT (self);
 	TelepathyClientPriv *priv = client->priv;
-	*/
 
 	int i;
 
 	for (i = 0; i < channels->len ; i++)
 	{
-		/* TODO: Put the channel in priv->channels */
-
 		GValueArray *arr = g_ptr_array_index (channels, i);
 		const gchar *object_path;
 		GHashTable *properties;
@@ -373,6 +372,8 @@ telepathy_client_handle_channels (TpSvcC
 			return;
 		}
 
+		priv->channels = g_list_append(priv->channels, channel);
+
 		purple_debug_info("telepathy", "New channel: %s\n", object_path);
 
 		tp_channel_call_when_ready(channel, channel_ready_cb, connection_data);


More information about the Commits mailing list