/pidgin/main: a899fa8f95d5: Implement purple_prpl_get_max_messag...

Tomasz Wasilczyk twasilczyk at pidgin.im
Mon Sep 9 06:59:45 EDT 2013


Changeset: a899fa8f95d54b447ed7a9a0037edc713454cd02
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2013-09-09 12:59 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/a899fa8f95d5

Description:

Implement purple_prpl_get_max_message_size

diffstat:

 libpurple/prpl.c |  17 +++++++++++++++++
 libpurple/prpl.h |  12 ++++++++++++
 2 files changed, 29 insertions(+), 0 deletions(-)

diffs (49 lines):

diff --git a/libpurple/prpl.c b/libpurple/prpl.c
--- a/libpurple/prpl.c
+++ b/libpurple/prpl.c
@@ -626,6 +626,23 @@ purple_prpl_got_media_caps(PurpleAccount
 #endif
 }
 
+gssize
+purple_prpl_get_max_message_size(PurplePlugin *prpl)
+{
+	PurplePluginProtocolInfo *prpl_info;
+
+	g_return_val_if_fail(prpl != NULL, 0);
+	g_return_val_if_fail(PURPLE_IS_PROTOCOL_PLUGIN(prpl), 0);
+
+	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
+	g_return_val_if_fail(prpl_info != NULL, 0);
+
+	if (!PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(prpl_info, get_max_message_size))
+		return 0;
+
+	return prpl_info->get_max_message_size(NULL);
+}
+
 /**************************************************************************
  * Protocol Plugin Subsystem API
  **************************************************************************/
diff --git a/libpurple/prpl.h b/libpurple/prpl.h
--- a/libpurple/prpl.h
+++ b/libpurple/prpl.h
@@ -972,6 +972,18 @@ gboolean purple_prpl_initiate_media(Purp
  */
 void purple_prpl_got_media_caps(PurpleAccount *account, const char *who);
 
+/**
+ * Gets the safe maximum message size in bytes for the protocol plugin.
+ *
+ * @see PurplePluginProtocolInfo#get_max_message_size
+ *
+ * @param prpl The protocol plugin to query.
+ *
+ * @return Maximum message size, 0 if unspecified, -1 for infinite.
+ */
+gssize
+purple_prpl_get_max_message_size(PurplePlugin *prpl);
+
 /*@}*/
 
 /**************************************************************************/



More information about the Commits mailing list