changeset 1864:5cb89cf24f45

[gaim-migrate @ 1874] hi there committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Sun, 20 May 2001 02:10:34 +0000
parents bf2434d36e54
children 8d758ff5957e
files plugins/irc.c plugins/jabber/jabber.c plugins/msn/msn.c src/conversation.c src/toc.c
diffstat 5 files changed, 20 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/irc.c	Sun May 20 00:01:55 2001 +0000
+++ b/plugins/irc.c	Sun May 20 02:10:34 2001 +0000
@@ -36,6 +36,7 @@
 #include <time.h>
 #include <sys/socket.h>
 #include <sys/stat.h>
+#include <ctype.h>
 #include "multi.h"
 #include "prpl.h"
 #include "gaim.h"
@@ -1862,7 +1863,7 @@
 			atoi(user->proto_opt[USEROPT_PROXYTYPE]),
 			user->proto_opt[USEROPT_USER], user->proto_opt[USEROPT_PASS],
 			irc_login_callback, gc);
-	if (idata->fd < 0) {
+	if (user->gc && (idata->fd < 0)) {
 		hide_login_progress(gc, "Unable to create socket");
 		signoff(gc);
 		return;
--- a/plugins/jabber/jabber.c	Sun May 20 00:01:55 2001 +0000
+++ b/plugins/jabber/jabber.c	Sun May 20 02:10:34 2001 +0000
@@ -477,7 +477,7 @@
 			atoi(user->proto_opt[USEROPT_PROXYTYPE]),
 			user->proto_opt[USEROPT_USER], user->proto_opt[USEROPT_PASS],
 			gjab_connected, j);
-	if (j->fd < 0) {
+	if (user->gc && (j->fd < 0)) {
 		STATE_EVT(JCONN_STATE_OFF)
 		return;
 	}
@@ -913,6 +913,7 @@
 			buddyname = g_strdup_printf("%s@%s", who->user, who->server);
 			if (strcasecmp(sub, "from") && strcasecmp(sub, "none") &&
 					!(b = find_buddy(GJ_GC(j), buddyname))) {
+				debug_printf("adding buddy: %s\n", buddyname);
 				b = add_buddy(GJ_GC(j), "Buddies", buddyname, name ? name : Jid);
 				do_export(GJ_GC(j));
 			}
@@ -963,6 +964,12 @@
 	g_free(buddy);
 }
 
+static gboolean jabber_disconnect(gpointer data)
+{
+	signoff(data);
+	return FALSE;
+}
+
 static void jabber_handleauthresp(gjconn j, jpacket p)
 {
 	if (jpacket_subtype(p) == JPACKET__RESULT) {
@@ -997,7 +1004,7 @@
 			hide_login_progress(GJ_GC(j), "Unknown login error");
 		}
 
-		signoff(GJ_GC(j));
+		gtk_timeout_add(50, jabber_disconnect, GJ_GC(j));
 	}
 }
 
--- a/plugins/msn/msn.c	Sun May 20 00:01:55 2001 +0000
+++ b/plugins/msn/msn.c	Sun May 20 02:10:34 2001 +0000
@@ -476,13 +476,13 @@
 
 		res = g_strsplit(buf, " ", 0);
 
-		// Kill the old one
+		/* Kill the old one */
 		g_free(md->friendly);
 
-		// Set the new one
+		/* Set the new one */
 		md->friendly = g_strdup(res[4]);
 
-		// And free up some memory.  That's all, folks.
+		/* And free up some memory.  That's all, folks. */
 		g_strfreev(res);
 	} else if (!strncmp("BYE ", buf, 4)) {
 		char **res;
@@ -552,6 +552,7 @@
 		gchar **address;
 		gchar **res;
 		struct msn_conn *mc = g_new0(struct msn_conn, 1);
+		struct aim_user *user = gc->user;
 		mc->gc = gc;
 
 		res = g_strsplit(buf, " ", 0);
@@ -570,7 +571,7 @@
 			msn_answer_callback, mc);
 		g_strfreev(address);
 		g_strfreev(res);
-		if (mc->fd < 0) {
+		if (user->gc && (mc->fd < 0)) {
 			/* Looks like we had an error connecting. */
 			g_free(mc->session);
 			g_free(mc->secret);
@@ -785,6 +786,7 @@
 		return;
 	} else if (!strncmp("XFR ", buf, 4)) {
 		char **res;
+		struct aim_user *user = gc->user;
 
 		res = g_strsplit(buf, " ", 0);
 
@@ -811,7 +813,7 @@
 			atoi(gc->user->proto_opt[USEROPT_PROXYTYPE]),
 			gc->user->proto_opt[USEROPT_USER], gc->user->proto_opt[USEROPT_PASS],
 			msn_login_callback, gc);
-		if (md->fd < 0) {
+		if (user->gc && (md->fd < 0)) {
 			g_strfreev(res);
 			hide_login_progress(gc, "Error connecting to server");
 			signoff(gc);
@@ -917,7 +919,7 @@
 			atoi(user->proto_opt[USEROPT_PROXYTYPE]),
 			user->proto_opt[USEROPT_USER], user->proto_opt[USEROPT_PASS],
 			msn_login_callback, gc);
-	if (md->fd < 0) {
+	if (user->gc && (md->fd < 0)) {
 		hide_login_progress(gc, "Error connecting to server");
 		signoff(gc);
 		return;
--- a/src/conversation.c	Sun May 20 00:01:55 2001 +0000
+++ b/src/conversation.c	Sun May 20 02:10:34 2001 +0000
@@ -1286,7 +1286,6 @@
 	char *str;
 	FILE *fd;
 	char colour[10];
-	int colorv = -1;
 	char *clr;
 	struct buddy *b;
 	int gtk_font_options = 0;
@@ -1381,10 +1380,6 @@
 		}
 
 	} else {
-		if ((clr = strstr(what, "<BODY BGCOLOR=\"#")) != NULL) {
-			sscanf(clr + strlen("<BODY BGCOLOR=\"#"), "%x", &colorv);
-		}
-
 		if (flags & WFLAG_WHISPER) {
 			/* if we're whispering, it's not an autoresponse */
 			if (meify(what)) {
--- a/src/toc.c	Sun May 20 00:01:55 2001 +0000
+++ b/src/toc.c	Sun May 20 02:10:34 2001 +0000
@@ -156,7 +156,7 @@
 			  user->proto_opt[USEROPT_USER], user->proto_opt[USEROPT_PASS],
 			  toc_login_callback, gc);
 
-	if (tdt->toc_fd < 0) {
+	if (user->gc && (tdt->toc_fd < 0)) {
 		g_snprintf(buf, sizeof(buf), "Connect to %s failed", user->proto_opt[USEROPT_AUTH]);
 		hide_login_progress(gc, buf);
 		signoff(gc);