/pidgin/main: d6d18b8e3c46: Revert my revision 485b1a932990

Mark Doliner mark at kingant.net
Sat Jan 5 23:45:42 EST 2013


Changeset: d6d18b8e3c4612e808665eeef12a903aca82b030
Author:	 Mark Doliner <mark at kingant.net>
Date:	 2013-01-05 20:45 -0800
Branch:	 default
URL: http://hg.pidgin.im/pidgin/main/rev/d6d18b8e3c46

Description:

Revert my revision 485b1a932990

Per discussion on devel at pidgin.im about revision f19649cf724b,
we're not absolutely sure we want to remove this function.  Let's
leave it in for now.

diffstat:

 libpurple/conversation.c |  12 ++++++++++++
 libpurple/conversation.h |  13 +++++++++++++
 2 files changed, 25 insertions(+), 0 deletions(-)

diffs (45 lines):

diff --git a/libpurple/conversation.c b/libpurple/conversation.c
--- a/libpurple/conversation.c
+++ b/libpurple/conversation.c
@@ -2501,6 +2501,18 @@ gpointer purple_conversation_get_ui_data
 	return conv->ui_data;
 }
 
+
+gboolean
+purple_conversation_do_command(PurpleConversation *conv, const gchar *cmdline,
+				const gchar *markup, gchar **error)
+{
+	char *mark = (markup && *markup) ? NULL : g_markup_escape_text(cmdline, -1), *err = NULL;
+	PurpleCmdStatus status = purple_cmd_do_command(conv, cmdline, mark ? mark : markup, error ? error : &err);
+	g_free(mark);
+	g_free(err);
+	return (status == PURPLE_CMD_STATUS_OK);
+}
+
 void *
 purple_conversations_get_handle(void)
 {
diff --git a/libpurple/conversation.h b/libpurple/conversation.h
--- a/libpurple/conversation.h
+++ b/libpurple/conversation.h
@@ -1361,6 +1361,19 @@ void purple_conv_chat_cb_destroy(PurpleC
  */
 GList * purple_conversation_get_extended_menu(PurpleConversation *conv);
 
+/**
+ * Perform a command in a conversation. Similar to @see purple_cmd_do_command
+ *
+ * @param conv    The conversation.
+ * @param cmdline The entire command including the arguments.
+ * @param markup  @c NULL, or the formatted command line.
+ * @param error   If the command failed errormsg is filled in with the appropriate error
+ *                message, if not @c NULL. It must be freed by the caller with g_free().
+ *
+ * @return  @c TRUE if the command was executed successfully, @c FALSE otherwise.
+ */
+gboolean purple_conversation_do_command(PurpleConversation *conv, const gchar *cmdline, const gchar *markup, gchar **error);
+
 /*@}*/
 
 /**************************************************************************/



More information about the Commits mailing list