changeset 1044:77b6bc7288d3

[gaim-migrate @ 1054] Thanks to Ryan C. Gordon for the Away message patch! committer: Tailor Script <tailor@pidgin.im>
author Rob Flynn <gaim@robflynn.com>
date Wed, 01 Nov 2000 11:22:04 +0000
parents 1528d05b3e6b
children e281fe55bc78
files AUTHORS doc/CREDITS doc/gaim.1 src/away.c
diffstat 4 files changed, 34 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/AUTHORS	Wed Nov 01 09:32:34 2000 +0000
+++ b/AUTHORS	Wed Nov 01 11:22:04 2000 +0000
@@ -4,6 +4,9 @@
 Rob Flynn <rflynn@blueridge.net> - Main developer (send patches here)
 Eric Warmenhoven <warmenhoven@yahoo.com> - Second in Command(patches here too)
 Syd Logan - Hacker and Designated Driver
-Todd Kulesza <fflewddur@linuxfreak.com> - Misc Code and Caffeine Consumer
+
+
+Retired
+------------------
 Jim Duchek <jimduchek@ou.edu> - Former Maintainer 
-Mark Spencer <markster@marko.net> - El Queso Grande
+Mark Spencer <markster@marko.net> - Original Author
--- a/doc/CREDITS	Wed Nov 01 09:32:34 2000 +0000
+++ b/doc/CREDITS	Wed Nov 01 11:22:04 2000 +0000
@@ -7,7 +7,6 @@
 Rob Flynn    	  <IM: RobFlynn>		rflynn@blueridge.net
 Eric Warmenhoven  <IM: EWarmenhoven>		warmenhoven@yahoo.com
 Syd Logan
-Todd Kulesza	  <IM: semblanceofself>		fflewddur@linuxfreak.com
 Jim Duchek        <IM: zilding>			jimduchek@ou.edu
 Mark Spencer      <IM: markster97>		markster@marko.net
 
@@ -47,6 +46,7 @@
 
 G. Sumner Hayes <IM: SumnerFool> Security Patches
 Brian Ryner for a little make file patch :)
+Ryan C. Gordon
 
 A big thanks to the X-Chat developers, who were kind enough to
 license X-Chat under the GPL so that I could learn to be as cool
--- a/doc/gaim.1	Wed Nov 01 09:32:34 2000 +0000
+++ b/doc/gaim.1	Wed Nov 01 11:22:04 2000 +0000
@@ -151,8 +151,6 @@
 .br
  Eric Warmenhoven <warmenhoven@yahoo.com> \- IM: EWarmenhoven
 .br
- Todd Kulesza <fflewddur@linuxfreak.com> \- IM: semblanceofself
-.br
  Jim Duchek <jim@linuxpimps.com> \- IM: Zilding
 .br
  Mark Spencer <markster@marko.net> \- IM: Markster97
--- a/src/away.c	Wed Nov 01 09:32:34 2000 +0000
+++ b/src/away.c	Wed Nov 01 11:22:04 2000 +0000
@@ -65,6 +65,28 @@
 	plugin_event(event_back, 0, 0, 0, 0);
 }
 
+
+/*
+ * rcg10312000 This could be more robust, but it works for my current
+ *  goal: to remove those annoying <BR> tags.  :)
+ */
+static void strncpy_nohtml(gchar *dest, const gchar *src, size_t destsize)
+{
+	gchar *ptr;
+	g_snprintf(dest, destsize, "%s", src);
+
+	while (1) {
+		ptr = strstr(dest, "<BR>");
+		if (ptr == NULL)  /* done? */
+			return;
+
+			/* replace <BR> with a newline. */
+		*ptr = '\n';
+		memmove(ptr + 1, ptr + 4, strlen(ptr + 4) + 1);
+	}
+}
+
+
 void do_away_message(GtkWidget *w, struct away_message *a)
 {
 	GtkWidget *back;
@@ -102,8 +124,13 @@
                 vbox = gtk_vbox_new(FALSE, 5);
 
 		awaytext = gtk_text_new(NULL, NULL);
+
+		/* rcg10312000 Convert basic HTML (<BR>, etc) to plain text.
 		g_snprintf(buf, sizeof(buf), "%s", a->message);
-                vscrollbar = gtk_vscrollbar_new(GTK_TEXT(awaytext)->vadj);
+		*/
+		strncpy_nohtml(buf, a->message, sizeof (buf));
+
+        vscrollbar = gtk_vscrollbar_new(GTK_TEXT(awaytext)->vadj);
 		gtk_widget_show(vscrollbar);
 		gtk_widget_set_usize(awaytext, 225, 75);
                 gtk_text_set_word_wrap(GTK_TEXT(awaytext), TRUE);