changeset 18025:7790021b1270

add a PURPLE_MESSAGE_NO_LINKIFY to prevent things from getting linkified
author Nathan Walp <nwalp@pidgin.im>
date Fri, 01 Jun 2007 00:36:00 +0000
parents 92e27556160c
children c3d03dd25434
files libpurple/conversation.c libpurple/conversation.h pidgin/gtkconv.c
diffstat 3 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/conversation.c	Wed May 30 05:37:04 2007 +0000
+++ b/libpurple/conversation.c	Fri Jun 01 00:36:00 2007 +0000
@@ -108,8 +108,12 @@
 
 	type = purple_conversation_get_type(conv);
 
-	/* Always linkfy the text for display */
-	displayed = purple_markup_linkify(message);
+	/* 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))
--- a/libpurple/conversation.h	Wed May 30 05:37:04 2007 +0000
+++ b/libpurple/conversation.h	Fri Jun 01 00:36:00 2007 +0000
@@ -116,7 +116,9 @@
 	PURPLE_MESSAGE_RAW         = 0x0800, /**< "Raw" message - don't
 	                                        apply formatting         */
 	PURPLE_MESSAGE_IMAGES      = 0x1000, /**< Message contains images  */
-	PURPLE_MESSAGE_NOTIFY      = 0x2000  /**< Message is a notification */
+	PURPLE_MESSAGE_NOTIFY      = 0x2000, /**< Message is a notification */
+	PURPLE_MESSAGE_NO_LINKIFY  = 0x4000  /**< Message should not be auto-
+										   linkified */
 
 } PurpleMessageFlags;
 
--- a/pidgin/gtkconv.c	Wed May 30 05:37:04 2007 +0000
+++ b/pidgin/gtkconv.c	Fri Jun 01 00:36:00 2007 +0000
@@ -5062,7 +5062,11 @@
 	g_return_if_fail(gc != NULL);
 
 	/* Make sure URLs are clickable */
-	displaying = purple_markup_linkify(message);
+	if(flags & PURPLE_MESSAGE_NO_LINKIFY)
+		displaying = g_strdup(message);
+	else
+		displaying = purple_markup_linkify(message);
+
 	plugin_return = GPOINTER_TO_INT(purple_signal_emit_return_1(
 							pidgin_conversations_get_handle(), (type == PURPLE_CONV_TYPE_IM ?
 							"displaying-im-msg" : "displaying-chat-msg"),