changeset 1496:d33bf6548543

[gaim-migrate @ 1506] hrm. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 22 Feb 2001 00:42:55 +0000
parents 3d1c4e5f375b
children c3a40af2b0c4
files doc/CREDITS doc/FAQ plugins/icq/gaim_icq.c plugins/napster.c plugins/yay/yay.c src/buddy.c src/gtkspell.c
diffstat 7 files changed, 49 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/doc/CREDITS	Wed Feb 21 19:22:50 2001 +0000
+++ b/doc/CREDITS	Thu Feb 22 00:42:55 2001 +0000
@@ -13,8 +13,9 @@
 Other Contributors:
 
 Adam Fritzler (mid)
-	Wrote libfaim, fixed the proxy code, and added the stuff to let
-	Oscar go through a proxy.
+	Wrote libfaim, fixed the proxy code, added the stuff to let
+	Oscar go through a proxy, and wrote the beginnings of the
+	Jabber plugin..
 
 Thanks to Torrey Searle for the spell checking code that
 accompanies the gtk_text box :)
--- a/doc/FAQ	Wed Feb 21 19:22:50 2001 +0000
+++ b/doc/FAQ	Thu Feb 22 00:42:55 2001 +0000
@@ -3,11 +3,10 @@
 1  The Basics
 	1.1  What does 'gaim' stand for?
 	1.2  Where are my log files stored?
-	1.3  Will you be adding a log viewer?
-	1.4  What are GtkHTML and GtkIMHtml, and why not just use GNOME's
+	1.3  What are GtkHTML and GtkIMHtml, and why not just use GNOME's
 	     GtkHTML?
-	1.5  How do I load plugins/perl scripts?
-	1.6  I'm not a native English speaker and I would like a translated
+	1.4  How do I load plugins/perl scripts?
+	1.5  I'm not a native English speaker and I would like a translated
 	     version of gaim.
 
 2  Multiple Connections
@@ -68,17 +67,7 @@
 Your logs are stored in $HOME/.gaim/logs/. They had previously been stored in
 $HOME/.gaim/YourScreenName/ (e.g. $HOME/.gaim/EWarmenhoven).
 
-1.3  Will you be adding a log viewer?
-
-Yes! As a matter of fact, we will be. Here's what needs to happen before then
-though:
-	GtkIMHtml has to be finished and added to gaim
-	The option to not log, and to strip HTML from logs, will be removed
-	HTML-matching must be done (e.g. if you get a message "<u>hi", it
-		should be logged as "<U>hi</U>" to prevent later logs from
-		being underlined)
-
-1.4  What are GtkHTML and GtkIMHtml, and why not just use GNOME's GtkHTML?
+1.3  What are GtkHTML and GtkIMHtml, and why not just use GNOME's GtkHTML?
 
 The widget GAIM had previously used to display HTML was called GtkHTML, and
 was written by Mark and Jim specifically for GAIM. Over time, Rob and Eric
@@ -97,7 +86,7 @@
 a strip-down version, CSCHTML, which doesn't use the GNOME libraries; but the
 first objection (that it supports too many tags) still applies.)
 
-1.5  How do I load plugins/perl scripts?
+1.4  How do I load plugins/perl scripts?
 
 Plugins you had loaded when you quit gaim are loaded again when you start
 gaim. To load a new plugin, either click 'Plugins' on the login screen, or
@@ -114,7 +103,7 @@
 plugin above), unload all your loaded scripts, and list which scripts you have
 loaded.
 
-1.6  I'm not a native English speaker and I would like a translated version of
+1.5  I'm not a native English speaker and I would like a translated version of
 gaim.
 
 Gaim currently has a few translations (French, Spanish, Korean, and Simplified
--- a/plugins/icq/gaim_icq.c	Wed Feb 21 19:22:50 2001 +0000
+++ b/plugins/icq/gaim_icq.c	Thu Feb 22 00:42:55 2001 +0000
@@ -130,12 +130,10 @@
 	struct gaim_connection *gc = find_gaim_conn_by_icq_link(link);
 	guint status;
 	char buf[256];
-	time_t t;
 
 	g_snprintf(buf, sizeof buf, "%lu", uin);
 	status = (st == STATUS_ONLINE) ? UC_NORMAL : UC_UNAVAILABLE | (st << 5);
-	time(&t);
-	serv_got_update(gc, buf, 1, 0, t, 0, status, 0);
+	serv_got_update(gc, buf, 1, 0, 0, 0, status, 0);
 }
 
 static void icq_user_offline(ICQLINK *link, unsigned long uin) {
--- a/plugins/napster.c	Wed Feb 21 19:22:50 2001 +0000
+++ b/plugins/napster.c	Thu Feb 22 00:42:55 2001 +0000
@@ -688,7 +688,7 @@
 
 		res = g_strsplit(buf, " ", 0);
 
-		serv_got_update(gc, res[0], 1, 0, time((time_t *)NULL), 0, 0, 0);
+		serv_got_update(gc, res[0], 1, 0, 0, 0, 0, 0);
 		
 		g_strfreev(res);
 		free(buf);
--- a/plugins/yay/yay.c	Wed Feb 21 19:22:50 2001 +0000
+++ b/plugins/yay/yay.c	Thu Feb 22 00:42:55 2001 +0000
@@ -87,18 +87,17 @@
 
 		b = find_buddy(gc, rec->id);
 		if (!b) continue;
-		time(&tmptime);
-		if (b->signon == 0) b->signon = tmptime;
 		if (!online)
 			serv_got_update(gc, b->name, 0, 0, 0, 0, 0, 0);
 		else {
 			if (rec->status == YAHOO_STATUS_AVAILABLE)
-				serv_got_update(gc, b->name, 1, 0, b->signon, 0, UC_NORMAL, 0);
-			else if (rec->status == YAHOO_STATUS_IDLE)
-				serv_got_update(gc, b->name, 1, 0, b->signon, tmptime - 600,
+				serv_got_update(gc, b->name, 1, 0, 0, 0, UC_NORMAL, 0);
+			else if (rec->status == YAHOO_STATUS_IDLE) {
+				time(&tmptime);
+				serv_got_update(gc, b->name, 1, 0, 0, tmptime - 600,
 						(rec->status << 5) | UC_NORMAL, 0);
-			else
-				serv_got_update(gc, b->name, 1, 0, b->signon, 0,
+			} else
+				serv_got_update(gc, b->name, 1, 0, 0, 0,
 						(rec->status << 5) | UC_UNAVAILABLE, 0);
 			if (rec->status == YAHOO_STATUS_CUSTOM) {
 				gpointer val = g_hash_table_lookup(yd->hash, b->name);
--- a/src/buddy.c	Wed Feb 21 19:22:50 2001 +0000
+++ b/src/buddy.c	Thu Feb 22 00:42:55 2001 +0000
@@ -1869,8 +1869,12 @@
 		gtk_widget_show(bs->idle);
 
 	/* now we do the tooltip */
-	sotime = sec_to_text(t - b->signon +
-			     ((struct gaim_connection *)bs->connlist->data)->correction_time);
+	if (b->signon) {
+		char *stime = sec_to_text(t - b->signon +
+				     ((struct gaim_connection *)bs->connlist->data)->correction_time);
+		sotime = g_strdup_printf(_("Logged in: %s\n"), stime);
+		g_free(stime);
+	}
 
 	if (b->idle)
 		itime = sec_to_text(t - b->idle);
@@ -1896,14 +1900,16 @@
 		caps[0] = '\0';
 
 	g_snprintf(infotip, sizeof infotip, _("Alias: %s               \nScreen Name: %s\n"
-				"Logged in: %s\n%s%s%s%s%s"),
-				b->show, b->name, sotime, warn,
+				"%s%s%s%s%s%s"),
+				b->show, b->name, 
+				(b->signon ? sotime : ""), warn,
 				(b->idle ? _("Idle: ") : ""), itime,
 				(b->idle ? "\n" : ""), caps);
 
 	gtk_tooltips_set_tip(tips, GTK_WIDGET(bs->item), infotip, "");
 
-	g_free(sotime);
+	if (b->signon)
+		g_free(sotime);
 	g_free(itime);
 }
 
--- a/src/gtkspell.c	Wed Feb 21 19:22:50 2001 +0000
+++ b/src/gtkspell.c	Thu Feb 22 00:42:55 2001 +0000
@@ -44,7 +44,7 @@
  * all ispell-related variables can be static.  
  */
 static pid_t spell_pid = -1;
-static int fd_write[2], fd_read[2];
+static int fd_write[2] = {0}, fd_read[2] = {0};
 static int signal_set_up = 0;
 
 /* FIXME? */
@@ -112,6 +112,9 @@
 void gtkspell_stop() {
 	if (gtkspell_running()) {
 		kill(spell_pid, SIGHUP); 
+		spell_pid = 0;
+		close(fd_read[0]);
+		close(fd_write[1]);
 	}
 }
 
@@ -139,11 +142,16 @@
 		return -1;
 	} else if (spell_pid == 0) {
 		dup2(fd_write[0], 0);
+		close(fd_write[0]);
+		close(fd_write[1]);
+
 		dup2(fd_read[1], 1);
-		dup2(fd_error[1], 2);
 		close(fd_read[0]);
+		close(fd_read[1]);
+
+		dup2(fd_error[1], 2);
 		close(fd_error[0]);
-		close(fd_write[1]);
+		close(fd_error[1]);
 
 		if (path == NULL) {
 			if (execvp(args[0], args) < 0) 
@@ -155,7 +163,7 @@
 		/* if we get here, we failed.
 		 * send some text on the pipe to indicate status.
 		 */
-		write(fd_read[1], "!", 1);
+		write(0, "!", 1); /* stdout _is_ the pipe. */
 
 		_exit(0);
 	} else {
@@ -167,11 +175,15 @@
 		fd_set rfds;
 		struct timeval tv;
 		
+		close(fd_write[0]);
+		close(fd_read[1]);
+
 		FD_ZERO(&rfds);
 		FD_SET(fd_error[0], &rfds);
 		FD_SET(fd_read[0], &rfds);
 		tv.tv_sec = 2;
 		tv.tv_usec = 0;
+
 		if (select(MAX(fd_error[0], fd_read[0])+1, 
 					&rfds, NULL, NULL, &tv) < 0) {
 			/* FIXME: is this needed? */
@@ -186,6 +198,10 @@
 			return -1;
 		}
 
+		/* we're done with stderr, now. */
+		close(fd_error[0]);
+		close(fd_error[1]);
+
 		/* otherwise, fd_read[0] is set. */
 		readline(buf);
 
@@ -416,6 +432,7 @@
 	}
 
 	gtk_editable_set_position(GTK_EDITABLE(gtktext), origpos);
+	gtk_editable_select_region(GTK_EDITABLE(gtktext), origpos, origpos);
 }
 
 static void entry_delete_cb(GtkText *gtktext,