changeset 19511:ea26d30449fd

Add a new flag PURPLE_MESSAGE_INVISIBLE which can be used to send a message in a conversation, but without displaying it in the conversation window. Use this new flag from Yahoo! when sending a buzz.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 28 Aug 2007 08:58:36 +0000
parents b17bd24fca8d
children 7b348650524e
files ChangeLog.API libpurple/conversation.c libpurple/conversation.h libpurple/protocols/yahoo/yahoo.c
diffstat 4 files changed, 19 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog.API	Tue Aug 28 08:53:48 2007 +0000
+++ b/ChangeLog.API	Tue Aug 28 08:58:36 2007 +0000
@@ -1,6 +1,12 @@
 Pidgin and Finch: The Pimpin' Penguin IM Clients That're Good for the Soul
 
 Version 2.2.0 (??/??/????):
+	libpurple:
+		Added:
+		* PURPLE_MESSAGE_INVISIBLE flag, which can be used by
+		  purple_conv_im_send_with_flags to send a message, but not display it
+		  in the conversation
+
 	Pidgin:
 		Added:
 		* pidgin_set_accessible_relations, sets up label-for and labelled-by
--- a/libpurple/conversation.c	Tue Aug 28 08:53:48 2007 +0000
+++ b/libpurple/conversation.c	Tue Aug 28 08:58:36 2007 +0000
@@ -112,17 +112,17 @@
 
 	/* Always linkfy the text for display, unless we're
 	 * explicitly asked to do otheriwse*/
-	if(msgflags & PURPLE_MESSAGE_NO_LINKIFY)
-		displayed = g_strdup(message);
-	else
-		displayed = purple_markup_linkify(message);
-
-	if ((conv->features & PURPLE_CONNECTION_HTML) &&
-		!(msgflags & PURPLE_MESSAGE_RAW))
-	{
+	if (!(msgflags & PURPLE_MESSAGE_INVISIBLE)) {
+		if(msgflags & PURPLE_MESSAGE_NO_LINKIFY)
+			displayed = g_strdup(message);
+		else
+			displayed = purple_markup_linkify(message);
+	}
+
+	if (displayed && (conv->features & PURPLE_CONNECTION_HTML) &&
+		!(msgflags & PURPLE_MESSAGE_RAW)) {
 		sent = g_strdup(displayed);
-	}
-	else
+	} else
 		sent = g_strdup(message);
 
 	msgflags |= PURPLE_MESSAGE_SEND;
--- a/libpurple/conversation.h	Tue Aug 28 08:53:48 2007 +0000
+++ b/libpurple/conversation.h	Tue Aug 28 08:58:36 2007 +0000
@@ -118,9 +118,9 @@
 	                                        apply formatting         */
 	PURPLE_MESSAGE_IMAGES      = 0x1000, /**< Message contains images  */
 	PURPLE_MESSAGE_NOTIFY      = 0x2000, /**< Message is a notification */
-	PURPLE_MESSAGE_NO_LINKIFY  = 0x4000  /**< Message should not be auto-
+	PURPLE_MESSAGE_NO_LINKIFY  = 0x4000, /**< Message should not be auto-
 										   linkified */
-
+	PURPLE_MESSAGE_INVISIBLE   = 0x8000, /**< Message should not be displayed */
 } PurpleMessageFlags;
 
 /**
--- a/libpurple/protocols/yahoo/yahoo.c	Tue Aug 28 08:53:48 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Tue Aug 28 08:58:36 2007 +0000
@@ -4096,9 +4096,7 @@
 
 	purple_debug(PURPLE_DEBUG_INFO, "yahoo",
 	           "Sending <ding> on account %s to buddy %s.\n", username, c->name);
-	/* TODO: find out how to send a <ding> without showing up as a blank line on
-	 * the conversation window. */
-	purple_conv_im_send(PURPLE_CONV_IM(c), "<ding>");
+	purple_conv_im_send_with_flags(PURPLE_CONV_IM(c), "<ding>", PURPLE_MESSAGE_INVISIBLE);
 
 	return TRUE;
 }