pidgin/pidgin

Merged in default (pull request #568)

2019-09-28, Gary Kramlich
bda7421f7207
Merged in default (pull request #568)

A handful of doc updates

Approved-by: Elliott Sales de Andrade
--- a/libpurple/cmds.h Fri Sep 27 20:38:57 2019 -0400
+++ b/libpurple/cmds.h Sat Sep 28 05:10:46 2019 +0000
@@ -18,6 +18,7 @@
#ifndef PURPLE_CMDS_H
#define PURPLE_CMDS_H
+
/**
* SECTION:cmds
* @section_id: libpurple-cmds
@@ -28,12 +29,20 @@
#include "conversation.h"
-/**************************************************************************/
-/* Structures */
-/**************************************************************************/
+/******************************************************************************
+ * Structures
+ *****************************************************************************/
/**
* PurpleCmdStatus:
+ * @PURPLE_CMD_STATUS_OK: The command executed successfully.
+ * @PURPLE_CMD_STATUS_FAILED: The command failed to execute.
+ * @PURPLE_CMD_STATUS_NOT_FOUND: The command was not found.
+ * @PURPLE_CMD_STATUS_WRONG_ARGS: The wrong number of arguments were passed.
+ * @PURPLE_CMD_STATUS_WRONG_PROTOCOL: The command was run with the wrong
+ * protocol.
+ * @PURPLE_CMD_STATUS_WRONG_TYPE: The Command was ran against the wrong type of
+ * conversation.
*
* The possible results of running a command with purple_cmd_do_command().
*/
@@ -48,9 +57,9 @@
/**
* PurpleCmdRet:
- * @PURPLE_CMD_RET_OK: Everything's okay; Don't look for another command
- * to call.
- * @PURPLE_CMD_RET_FAILED: The command failed, but stop looking.
+ * @PURPLE_CMD_RET_OK: Everything's okay; Don't look for another command to
+ * call.
+ * @PURPLE_CMD_RET_FAILED: The command failed, but stop looking.
* @PURPLE_CMD_RET_CONTINUE: Continue, looking for other commands with the same
* name to call.
*
@@ -71,10 +80,14 @@
/**
* PurpleCmdFunc:
+ * @conversation: The #PurpleConversation where the command is being run.
+ * @cmd: The name of the command.
+ * @args: The arguments to the command.
+ * @error: (out): A return address for a #GError.
+ * @data: User data to pass to the function.
*
* A function implementing a command, as passed to purple_cmd_register().
*/
-/* TODO document the arguments to these functions. */
typedef PurpleCmdRet (*PurpleCmdFunc)(PurpleConversation *conversation, const gchar *cmd,
gchar **args, gchar **error, void *data);
/**
@@ -86,6 +99,21 @@
*/
typedef guint PurpleCmdId;
+/**
+ * PurpleCmdPriority:
+ * @PURPLE_CMD_P_VERY_LOW: Lowest priority.
+ * @PURPLE_CMD_P_LOW: Low priority.
+ * @PURPLE_CMD_P_DEFAULT: Default priority.
+ * @PURPLE_CMD_P_PROTOCOL: Priority for protocol plugins.
+ * @PURPLE_CMD_P_PLUGIN: Priority for plugins.
+ * @PURPLE_CMD_P_ALIAS: Priority for aliasing commands.
+ * @PURPLE_CMD_P_HIGH: High priority.
+ * @PURPLE_CMD_P_VERY_HIGH: Highest priority.
+ *
+ * Commands are registered from multiple locations which leads to name
+ * collisions. PurpleCmdPriority is used to determine which command will be
+ * run.
+ */
typedef enum {
PURPLE_CMD_P_VERY_LOW = -1000,
PURPLE_CMD_P_LOW = 0,
--- a/libpurple/connection.c Fri Sep 27 20:38:57 2019 -0400
+++ b/libpurple/connection.c Sat Sep 28 05:10:46 2019 +0000
@@ -648,7 +648,18 @@
* keepalive mechanism is inactive.
*/
if (priv->keepalive) {
- purple_timeout_reset(priv->keepalive, purple_protocol_server_iface_get_keepalive_interval(priv->protocol));
+ /* The #GTimeoutSource API doesn't expose a function to reset when a
+ * #GTimeoutSource will dispatch the next time, but because it works to
+ * directly call g_source_set_ready_time() on a #GTimeoutSource, and since
+ * it seems unlikely that the implementation will change, we just do that
+ * for now as a workaround for this API shortcoming.
+ */
+ gint64 seconds_from_now = purple_protocol_server_iface_get_keepalive_interval(priv->protocol);
+
+ g_source_set_ready_time(
+ priv->keepalive,
+ g_get_monotonic_time() + (seconds_from_now * G_USEC_PER_SEC)
+ );
}
}
--- a/libpurple/image.h Fri Sep 27 20:38:57 2019 -0400
+++ b/libpurple/image.h Sat Sep 28 05:10:46 2019 +0000
@@ -43,6 +43,7 @@
#define PURPLE_TYPE_IMAGE purple_image_get_type()
struct _PurpleImageClass {
+ /*< private >*/
GObjectClass parent_class;
void (*purple_reserved1)(void);
--- a/libpurple/log.h Fri Sep 27 20:38:57 2019 -0400
+++ b/libpurple/log.h Sat Sep 28 05:10:46 2019 +0000
@@ -67,7 +67,7 @@
* @finalize: Called when the log is destroyed
* @list: This function returns a sorted #GList of available PurpleLogs
* @read: Given one of the logs returned by the logger's list function,
- * this returns the contents of the log in #GtkWebView markup
+ * this returns the contents of the log
* @size: Given one of the logs returned by the logger's list function,
* this returns the size of the log in bytes
* @total_size: Returns the total size of all the logs. If this is undefined a
--- a/libpurple/util.c Fri Sep 27 20:38:57 2019 -0400
+++ b/libpurple/util.c Sat Sep 28 05:10:46 2019 +0000
@@ -932,16 +932,6 @@
}
-/**************************************************************************/
-/* GLib Event Loop Functions */
-/**************************************************************************/
-
-void purple_timeout_reset(GSource *source, gint64 seconds_from_now)
-{
- g_source_set_ready_time(source, g_get_monotonic_time() + (seconds_from_now * G_USEC_PER_SEC));
-}
-
-
/**************************************************************************
* Markup Functions
**************************************************************************/
--- a/libpurple/util.h Fri Sep 27 20:38:57 2019 -0400
+++ b/libpurple/util.h Sat Sep 28 05:10:46 2019 +0000
@@ -322,43 +322,6 @@
/**************************************************************************/
-/* GLib Event Loop Functions */
-/**************************************************************************/
-
-/**
- * purple_timeout_reset:
- * @source: A #GTimeoutSource.
- * @seconds_from_now: Seconds to add to current monotonic time.
- *
- * Resets a #GTimeoutSource to be dispatched after @seconds_from_now seconds,
- * after which it'll continue dispatching at its specified interval.
- *
- * The #GSource API exposes a function g_source_set_ready_time(), which is
- * meant to be used for implementing custom source types. It sets a #GSource
- * to be dispatched when the given monotonic time is reached, and it's also
- * the function that's used by the #GTimeoutSource implementation to keep
- * dispatching at a specified interval.
- *
- * The #GTimeoutSource API doesn't expose a function to reset when a
- * #GTimeoutSource will dispatch the next time, but because it works to
- * directly call g_source_set_ready_time() on a #GTimeoutSource, and since
- * it seems unlikely that the implementation will change, we just do that
- * for now as a workaround for this API shortcoming.
- *
- * For the moment, these would be correct ways to achieve a similar effect,
- * both of which are ugly:
- *
- * - Remove the old #GTimeoutSource by calling g_source_remove(), and add a
- * new #GTimeoutSource by calling g_timeout_add_seconds(). Destroying and
- * creating #GSource objects is unnecessarily expensive.
- * - Implement a custom #GResettableTimeoutSource. This means duplicating
- * #GTimeoutSource and adding one function g_resettable_timeout_reset()
- * which simply calls g_source_set_ready_time().
- */
-void purple_timeout_reset(GSource *source, gint64 seconds_from_now);
-
-
-/**************************************************************************/
/* Markup Functions */
/**************************************************************************/