changeset 7070:b794695d7c72

[gaim-migrate @ 7635] Arun A Tharuvai (aat) writes: " The function zephyr_to_html() occasionally interprets some actual text as non-functional formatting code to be ignored. All text between an @ sign (used to start tags), and the first opener (one of '<', '{', '[', or '(' ) for example, From: <foo@bar.com>, <baz@quux.com> was getting munged to From: <foobaz@quux.com> The attached patch checks for the existence of a closer between an @ and an opener, outputting the section verbatim." committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Tue, 30 Sep 2003 12:54:58 +0000
parents 184ec972f0f5
children 470b14b1c70d
files ChangeLog src/protocols/zephyr/zephyr.c
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Sep 30 12:49:20 2003 +0000
+++ b/ChangeLog	Tue Sep 30 12:54:58 2003 +0000
@@ -8,6 +8,7 @@
 	* Multiple copies of gaim installed at different locations no
 	  longer attempt to load the same, possibly incompatible plugins
 	  (Robert McQueen)
+	* Zepher formatting fixes (Arun A Tharuvai)
 	* Chinese (Traditional) translation updated (Ambrose C. Li)
 
 version 0.70 (09/28/2003):
--- a/src/protocols/zephyr/zephyr.c	Tue Sep 30 12:49:20 2003 +0000
+++ b/src/protocols/zephyr/zephyr.c	Tue Sep 30 12:54:58 2003 +0000
@@ -195,7 +195,7 @@
 			char *buf;
 			int end;
 			for (end=1; (cnt+end) <= len &&
-					!IS_OPENER(message[cnt+end]); end++);
+					!IS_OPENER(message[cnt+end]) && !IS_CLOSER(message[cnt+end]); end++);
 			buf = g_new0(char, end);
 			if (end) {
 				g_snprintf(buf, end, "%s", message+cnt+1);
@@ -243,7 +243,17 @@
 				if ((cnt+end) > len) {
 					g_string_append_c(frames->text, '@');
 					cnt++;
-				} else {
+				} else if (IS_CLOSER(message[cnt+end])) {
+                                        /* We have @chars..closer . This is 
+                                           merely a sequence of chars that isn't a formatting tag
+                                        */
+                                        int tmp=cnt;
+                                        while (tmp<=cnt+end) {
+                                                g_string_append_c(frames->text,message[tmp]);
+                                                tmp++;
+                                        }
+                                        cnt+=end+1;
+                                } else {
 					/* unrecognized thingie. act like it's not there, but we
 					 * still need to take care of the corresponding closer,
 					 * make a frame that does nothing. */