# HG changeset patch # User Sadrul Habib Chowdhury # Date 1188291516 0 # Node ID ea26d30449fd5e1be5bffe321d1d70b63c11e0ad # Parent b17bd24fca8d01f765ab8e13d5e3c2bcfd4919f0 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. diff -r b17bd24fca8d -r ea26d30449fd ChangeLog.API --- 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 diff -r b17bd24fca8d -r ea26d30449fd libpurple/conversation.c --- 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; diff -r b17bd24fca8d -r ea26d30449fd libpurple/conversation.h --- 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; /** diff -r b17bd24fca8d -r ea26d30449fd libpurple/protocols/yahoo/yahoo.c --- 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 on account %s to buddy %s.\n", username, c->name); - /* TODO: find out how to send a without showing up as a blank line on - * the conversation window. */ - purple_conv_im_send(PURPLE_CONV_IM(c), ""); + purple_conv_im_send_with_flags(PURPLE_CONV_IM(c), "", PURPLE_MESSAGE_INVISIBLE); return TRUE; }