soc.2009.telepathy: 5f74503b: Documented telepathy_channel_list.*

sttwister at gmail.com sttwister at gmail.com
Tue Dec 22 10:01:23 EST 2009


-----------------------------------------------------------------
Revision: 5f74503b62e2e86878d805b68fbe0afed372f381
Ancestor: 1b740d4c16fcab78970f88764b04a7ae4d014021
Author: sttwister at gmail.com
Date: 2009-12-22T14:54:55
Branch: im.pidgin.soc.2009.telepathy
URL: http://d.pidgin.im/viewmtn/revision/info/5f74503b62e2e86878d805b68fbe0afed372f381

Modified files:
        libpurple/protocols/telepathy/telepathy_avatar.h
        libpurple/protocols/telepathy/telepathy_channel.c
        libpurple/protocols/telepathy/telepathy_channel_list.c
        libpurple/protocols/telepathy/telepathy_channel_list.h

ChangeLog: 

Documented telepathy_channel_list.*

-------------- next part --------------
============================================================
--- libpurple/protocols/telepathy/telepathy_avatar.h	da569f0477bc861a6624e43ef2ee51bc19531538
+++ libpurple/protocols/telepathy/telepathy_avatar.h	e49c8ccc405ba705e9cdf29798d77ad29abbc6c1
@@ -107,6 +107,7 @@ set_avatar_cb (TpConnection *proxy,
 /**
  * Callback for the ClearAvatar DBus method.
  */
+void
 clear_avatar_cb (TpConnection *proxy,
                  const GError *error,
                  gpointer user_data,
============================================================
--- libpurple/protocols/telepathy/telepathy_channel.c	23cdd792b3d84cb2b38215e14d89c25b0d13b584
+++ libpurple/protocols/telepathy/telepathy_channel.c	53983ce9880d9db9486e7b37f10b9cfd809cda77
@@ -144,19 +144,23 @@ handle_new_channel (PrplTpConnection *da
 handle_new_channel (PrplTpConnection *data,
                     const GValueArray *channel_Properties)
 {
+	char *object_Path;
+	GHashTable *map;
+	GError *error = NULL;
+	TpChannel *channel;
+	TpConnection *connection;
+	const gchar *channel_Type;
+
 	g_return_if_fail(data != NULL);
 	g_return_if_fail(channel_Properties != NULL);
 
 	/* Extract the object path and properties map. */
-	char *object_Path = g_value_get_boxed(g_value_array_get_nth((GValueArray *)channel_Properties, 0));
-	GHashTable *map = g_value_get_boxed(g_value_array_get_nth((GValueArray *)channel_Properties, 1));
+	object_Path = g_value_get_boxed(g_value_array_get_nth((GValueArray *)channel_Properties, 0));
+	map = g_value_get_boxed(g_value_array_get_nth((GValueArray *)channel_Properties, 1));
 
-	GError *error = NULL;
-	TpConnection *connection = data->connection;
+	connection = data->connection;
 
-	TpChannel *channel;
-	const gchar *channel_Type = g_value_get_string(
-		g_hash_table_lookup(map, TP_IFACE_CHANNEL ".ChannelType"));
+	channel_Type = g_value_get_string(g_hash_table_lookup(map, TP_IFACE_CHANNEL ".ChannelType"));
 
 	if (channel_Type == NULL)
 	{
============================================================
--- libpurple/protocols/telepathy/telepathy_channel_list.c	2a2d4cc3564f96f938028b52ddd1865fe792d1ab
+++ libpurple/protocols/telepathy/telepathy_channel_list.c	f723a8239e34642cac7a31c07497d6043efff4fd
@@ -68,6 +68,16 @@ add_members_cb (TpChannel *proxy,
 	purple_debug_warning("telepathy", "AddMembers succeeded!\n");
 }
 
+/**
+ * Callback for purple_account_request_authrization() when user accepts
+ * authorization.
+ *
+ * Adds a contact handle to a group, as specified in the passed data.
+ *
+ * @param user_data Points to a #PrplTpAuthorizationRequest containing
+ *                  information about the contact requesting authorization and
+ *                  the channel where the contact will be added.
+ */
 static void
 request_authorization_auth_cb (gpointer user_data)
 {
@@ -89,9 +99,13 @@ request_authorization_auth_cb (gpointer 
 			add_members_cb, user_data,
 			NULL, NULL);
 
+	g_free((gpointer)request->message);
 	g_free(request);	
 }
 
+/**
+ * Callback for the RemoveMembers DBus method.
+ */
 static void
 remove_members_cb (TpChannel *proxy,
                    const GError *error,
@@ -104,9 +118,19 @@ remove_members_cb (TpChannel *proxy,
 		return;
 	}
 	
-	purple_debug_warning("telepathy", "RemoveMembers succeeded!\n");
+	purple_debug_info("telepathy", "RemoveMembers succeeded!\n");
 }
 
+/**
+ * Callback for purple_account_request_authrization() when user denies
+ * authorization.
+ *
+ * Remove the contact from the channel's local-pending list.
+ *
+ * @param user_data Points to a #PrplTpAuthorizationRequest containing
+ *                  information about the contact requesting authorization and
+ *                  the channel that the contact wants to join.
+ */
 static void
 request_authorization_deny_cb (gpointer user_data)
 {
@@ -130,9 +154,27 @@ request_authorization_deny_cb (gpointer 
 			remove_members_cb, user_data,
 			NULL, NULL);
 
+	g_free((gpointer)request->message);
 	g_free(request);	
 }
 
+/**
+ * Callback for the tp_connection_get_contacts_by_handle() method.
+ *
+ * Called when some contacts request authorization.
+ *
+ * Forwards the requests to libpurple in order to query the user about the
+ * requests. Appropiate action is taken depending whether the user accepts or
+ * denies the request.
+ *
+ * @param connection The connection proxy object.
+ * @param n_contacts The number of contacts successfully received.
+ * @param contacts   An array of contacts that were successfully received.
+ * @param n_failed   The number of contacts failed to receive.
+ * @param failed     An array of contacts failed to receive.
+ * @param error      Points to a GError on failure, @c NULL otherwise.
+ * @param user_data  Points to #PrplTpAuthorizationRequest.
+ */
 static void
 request_authorization_cb (TpConnection *connection,
                           guint n_contacts,
@@ -182,6 +224,21 @@ request_authorization_cb (TpConnection *
 	g_free(data);
 }
 
+/**
+ * Callback for the MembersChanged DBus signal.
+ * 
+ * Checks if any contacts joined local-pending (they request authorization).
+ *
+ * @param proxy              The channel proxy object.
+ * @param arg_Message        An optional message sent by the server.
+ * @param arg_Added          A list of contacts added to the channel.
+ * @param arg_Removed        A list of contacts removed from the channel.
+ * @param arg_Local_Pending  A list of contacts pending local authorization.
+ * @param arg_Remote_Pending A list of contacts pending remote authroization.
+ * @param arg_Actor          The contact handle who requested the change.
+ * @param arg_Reason         The reason for the change.
+ * @param user_data          Points to a #PrplTpConnection.
+ */
 static void
 members_changed_cb (TpChannel *proxy,
                     const gchar *arg_Message,
@@ -247,6 +304,16 @@ members_changed_cb (TpChannel *proxy,
 	}
 }
 
+/**
+ * Callback for the GetLocalPendingMembersWithInfo DBus callback.
+ * 
+ * Checks if there are any contacts who request authorization upon login.
+ *
+ * @param proxy     The channel proxy object.
+ * @param out_Info  An array containing member information.
+ * @param error     Points to a GError on failure, @c NULL otherwise.
+ * @param user_data Points to a #PrplTpConnection.
+ */
 static void
 get_local_pending_members_with_info_cb (TpChannel *proxy,
                                         const GPtrArray *out_Info,
============================================================
--- libpurple/protocols/telepathy/telepathy_channel_list.h	52429be1529077b9d5b8929f29966acca76b296f
+++ libpurple/protocols/telepathy/telepathy_channel_list.h	ff36d19fb06c571b2d61c47c4b7403d4c03a759f
@@ -48,9 +48,17 @@ typedef struct
 
 } PrplTpGroup;
 
+/**
+ * Free the memory of a #PrplTpGroup.
+ *
+ * @param tp_group The struct to clean up.
+ */
 void
 destroy_group(PrplTpGroup *tp_group);
 
+/**
+ * Callback for the CreateGroup DBus method.
+ */
 void
 create_group_channel_cb (TpConnection *proxy,
                          const gchar *out_Channel,
@@ -59,12 +67,24 @@ create_group_channel_cb (TpConnection *p
                          gpointer user_data,
                          GObject *weak_object);
 
+/**
+ * Callback for the AddMembers DBus method.
+ */
 void
 add_members_cb (TpChannel *proxy,
                 const GError *error,
                 gpointer user_data,
                 GObject *weak_object);
 
+/**
+ * Handles a newly created list channel.
+ *
+ * Caches information about the channel and gathers more information about the
+ * channel members.
+ *
+ * @param channel The channel proxy object.
+ * @param data    The connection that created the channel.
+ */
 void
 handle_list_channel (TpChannel *channel,
                      PrplTpConnection *data);


More information about the Commits mailing list