changeset 8533:ef3d81aa663a

[gaim-migrate @ 9272] " This patch marks up outgoing links in Yahoo so that the URL is linked instead of the description (as was happening before). It sort-of fixes SimGuy bug #24 - not by disabling the insert link button, but by formatting links such that the link is usable by the recipient. A GAIM_CONNECTION_NO_URLDESCRIPTION connection flag might be useful so we don't bother asking for a description if the protocol (eg. MSN, Yahoo & Zephyr) doesn't support it in links, but I'll leave that for another day, another patch." --Stu Tomlinson committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 31 Mar 2004 03:10:37 +0000
parents f9094d171b04
children 389e2b9dae6a
files src/protocols/yahoo/util.c
diffstat 1 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/util.c	Wed Mar 31 02:52:09 2004 +0000
+++ b/src/protocols/yahoo/util.c	Wed Mar 31 03:10:37 2004 +0000
@@ -592,16 +592,28 @@
 							i = t - src;
 							break;
 						}
-					} else if (!g_ascii_strncasecmp(&src[i+1], "A", j - i - 1)) {
-					    while (1) {
-						    if (++j >= len) {
-							    g_string_append(dest, &src[i]);
+					} else if (!g_ascii_strncasecmp(&src[i+1], "A HREF=\"", j - i - 1)) {
+						j += 7;
+						g_string_append(dest, "\033[lm");
+						while (1) {
+							g_string_append_c(dest, src[j]);
+							if (++j >= len) {
 								i = len;
 								break;
 							}
-							if (src[j] == '>') {
-							    g_string_append(dest, "\033[lm");
-							    i = j;
+							if (src[j] == '"') {
+								g_string_append(dest, "\033[xlm");
+								while (1) {
+									if (++j >= len) {
+										i = len;
+										break;
+									}
+									if (!g_ascii_strncasecmp(&src[j], "</A>", 4)) {
+										j += 3;
+										break;
+									}
+								}
+								i = j;
 								break;
 							}
 						}