changeset 6122:914f2d5da21c

[gaim-migrate @ 6596] Fix 2 compiler warnings. Make auto-login for IRC accounts without passwords work. Thanks to Luke for finding this and making a kick-assingly correct guess as to the cause. Fix the MSN sign-off-infinite-loops-after-getting-info-about-mail bug. Fix "Yahoo smilies for the "angel" smiley are incorrect" http://sourceforge.net/tracker/index.php?func=detail&aid=728663&group_id=235&atid=100235 Fix a bug that I introduced yesterday freaking afternoon. I would have commited the fix yesterday, but SF CVS was not working. <faceprint> KingAnt: you just broke the ticker <KingAnt> faceprint: How so? <KingAnt> Oh, event_signon? <faceprint> the ticker is what needs event_buddy_signon to get called twice <faceprint> i don't know what is the right behavior, but i'm in bootloader hell, just thought i'd alert you <KingAnt> faceprint: So that it doesn't always show people with the open door? <faceprint> KingAnt: right I just added an ugly little timeout that updates the icon after 11 seconds. The icon in the blist gets updated after 10. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 14 Jul 2003 22:09:42 +0000
parents 37c679a484c9
children adabfcf8abe1
files pixmaps/smileys/default/theme plugins/ticker/ticker.c src/account.c src/gtkaccount.c src/gtkprefs.c src/protocols/msn/servconn.c
diffstat 6 files changed, 73 insertions(+), 43 deletions(-) [+]
line wrap: on
line diff
--- a/pixmaps/smileys/default/theme	Mon Jul 14 14:36:03 2003 +0000
+++ b/pixmaps/smileys/default/theme	Mon Jul 14 22:09:42 2003 +0000
@@ -77,7 +77,7 @@
 msn_embarrassed.png	:$ :-$
 
 [Yahoo]
-yahoo_angel.gif		o:) o:-) O:-) O:)
+yahoo_angel.gif		o:) o:-) O:-) O:) 0:-)
 yahoo_angry.gif		X-( x-( X( x(
 yahoo_batting.gif	;;)
 yahoo_bigsmile.gif	:D :-D
--- a/plugins/ticker/ticker.c	Mon Jul 14 14:36:03 2003 +0000
+++ b/plugins/ticker/ticker.c	Mon Jul 14 22:09:42 2003 +0000
@@ -1,4 +1,7 @@
-/* GTK - The GIMP Toolkit
+/*
+ * Gaim Ticker Plugin
+ * The line below doesn't apply at all, does it?  It should be Syd, Sean, and 
+ * maybe Nathan, I believe.
  * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
  *
  * This library is free software; you can redistribute it and/or
@@ -43,6 +46,7 @@
 	GtkWidget *ebox;
 	GtkWidget *label;
 	GtkWidget *icon;
+	guint timeout;
 } TickerData;
 
 GList *tickerbuds = NULL;
@@ -112,6 +116,16 @@
 	g_object_unref(G_OBJECT(pixbuf));
 }
 
+static gboolean buddy_ticker_set_pixmap_cb(gpointer data) {
+	TickerData *td = data;
+
+gaim_debug(GAIM_DEBUG_ERROR, "XXX", "we're updating the pixmap, you bitch\n");
+	buddy_ticker_set_pixmap(td->buddy);
+	td->timeout = 0;
+
+	return FALSE;
+}
+
 static void buddy_ticker_add_buddy(struct buddy *b) {
 	GtkWidget *hbox;
 	TickerData *td;
@@ -121,7 +135,7 @@
 	if (!ticker)
 		return;
 
-	if(buddy_ticker_find_buddy(b))
+	if (buddy_ticker_find_buddy(b))
 		return;
 
 	td = g_new0(TickerData, 1);
@@ -143,6 +157,12 @@
 
 	gtk_widget_show_all(td->ebox);
 	gtk_widget_show(tickerwindow);
+
+	/*
+	 * Update the icon in a few seconds (after the open door icon has
+	 * changed).  This is somewhat ugly.
+	 */
+	td->timeout = g_timeout_add(11000, buddy_ticker_set_pixmap_cb, td);
 }
 
 static void buddy_ticker_remove_buddy(struct buddy *b) {
@@ -156,6 +176,8 @@
 
 	gtk_ticker_remove(GTK_TICKER(ticker), td->ebox);
 	tickerbuds = g_list_remove(tickerbuds, td);
+	if (td->timeout != 0)
+		g_source_remove(td->timeout);
 	g_free(td);
 }
 
@@ -181,7 +203,35 @@
 	}
 }
 
-void signon_cb(GaimConnection *gc, char *who) {
+void signoff_cb(GaimConnection *gc) {
+	TickerData *td;
+	if (!gaim_connections_get_all()) {
+		while (tickerbuds) {
+			td = tickerbuds->data;
+			tickerbuds = g_list_delete_link(tickerbuds, tickerbuds);
+			if (td->timeout != 0)
+				g_source_remove(td->timeout);
+			g_free(td);
+		}
+		gtk_widget_destroy(tickerwindow);
+		tickerwindow = NULL;
+		ticker = NULL;
+	} else {
+		GList *t = tickerbuds;
+		while (t) {
+			td = t->data;
+			t = t->next;
+			if (td->buddy->account == gc->account) {
+				tickerbuds = g_list_remove(tickerbuds, td);
+				if (td->timeout != 0)
+					g_source_remove(td->timeout);
+				g_free(td);
+			}
+		}
+	}
+}
+
+void buddy_signon_cb(GaimConnection *gc, char *who) {
 	struct buddy *b = gaim_find_buddy(gc->account, who);
 	if(buddy_ticker_find_buddy(b))
 		buddy_ticker_set_pixmap(b);
@@ -189,31 +239,8 @@
 		buddy_ticker_add_buddy(b);
 }
 
-void signoff_cb(GaimConnection *gc) {
-	if (!gaim_connections_get_all()) {
-		while(tickerbuds) {
-			g_free(tickerbuds->data);
-			tickerbuds = g_list_delete_link(tickerbuds, tickerbuds);
-		}
-		gtk_widget_destroy(tickerwindow);
-		tickerwindow = NULL;
-		ticker = NULL;
-	} else {
-		GList *t = tickerbuds;
-		while(t) {
-			TickerData *td = t->data;
-			t = t->next;
-			if(td->buddy->account == gc->account) {
-				g_free(td);
-				tickerbuds = g_list_remove(tickerbuds, td);
-			}
-		}
-	}
-}
-
 void buddy_signoff_cb(GaimConnection *gc, char *who) {
 	struct buddy *b = gaim_find_buddy(gc->account, who);
-
 	buddy_ticker_remove_buddy(b);
 	if(!tickerbuds)
 		gtk_widget_hide(tickerwindow);
@@ -234,8 +261,8 @@
 static gboolean
 plugin_load(GaimPlugin *plugin)
 {
-	gaim_signal_connect(plugin, event_buddy_signon, signon_cb, NULL);
 	gaim_signal_connect(plugin, event_signoff, signoff_cb, NULL);
+	gaim_signal_connect(plugin, event_buddy_signon, buddy_signon_cb, NULL);
 	gaim_signal_connect(plugin, event_buddy_signoff, buddy_signoff_cb, NULL);
 	gaim_signal_connect(plugin, event_buddy_away, away_cb, NULL);
 	gaim_signal_connect(plugin, event_buddy_back, away_cb, NULL);
@@ -249,9 +276,14 @@
 static gboolean
 plugin_unload(GaimPlugin *plugin)
 {
-	while(tickerbuds) {
-		g_free(tickerbuds->data);
+	TickerData *td;
+
+	while (tickerbuds) {
+		td = tickerbuds->data;
 		tickerbuds = g_list_delete_link(tickerbuds, tickerbuds);
+		if (td->timeout != 0)
+			g_source_remove(td->timeout);
+		g_free(td);
 	}
 
 	if (tickerwindow != NULL) {
--- a/src/account.c	Mon Jul 14 14:36:03 2003 +0000
+++ b/src/account.c	Mon Jul 14 22:09:42 2003 +0000
@@ -1246,11 +1246,8 @@
 	for (l = gaim_accounts_get_all(); l != NULL; l = l->next) {
 		account = l->data;
 
-		if (gaim_account_get_auto_login(account, ui) &&
-			gaim_account_get_remember_password(account)) {
-
+		if (gaim_account_get_auto_login(account, ui))
 			gaim_account_connect(account);
-		}
 	}
 }
 
--- a/src/gtkaccount.c	Mon Jul 14 14:36:03 2003 +0000
+++ b/src/gtkaccount.c	Mon Jul 14 22:09:42 2003 +0000
@@ -711,6 +711,13 @@
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 	gtk_widget_show(item);
 
+	/* HTTP */
+	item = gtk_menu_item_new_with_label(_("HTTP"));
+	g_object_set_data(G_OBJECT(item), "proxytype",
+					  GINT_TO_POINTER(GAIM_PROXY_HTTP));
+	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+	gtk_widget_show(item);
+
 	/* SOCKS 4 */
 	item = gtk_menu_item_new_with_label(_("SOCKS 4"));
 	g_object_set_data(G_OBJECT(item), "proxytype",
@@ -725,13 +732,6 @@
 	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 	gtk_widget_show(item);
 
-	/* HTTP */
-	item = gtk_menu_item_new_with_label(_("HTTP"));
-	g_object_set_data(G_OBJECT(item), "proxytype",
-					  GINT_TO_POINTER(GAIM_PROXY_HTTP));
-	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
-	gtk_widget_show(item);
-
 	gtk_option_menu_set_menu(GTK_OPTION_MENU(dropdown), menu);
 
 	return dropdown;
--- a/src/gtkprefs.c	Mon Jul 14 14:36:03 2003 +0000
+++ b/src/gtkprefs.c	Mon Jul 14 22:09:42 2003 +0000
@@ -24,6 +24,7 @@
 #include "internal.h"
 
 #include "debug.h"
+#include "html.h"
 #include "notify.h"
 #include "prefs.h"
 #include "proxy.h"
--- a/src/protocols/msn/servconn.c	Mon Jul 14 14:36:03 2003 +0000
+++ b/src/protocols/msn/servconn.c	Mon Jul 14 22:09:42 2003 +0000
@@ -128,10 +128,10 @@
 			g_free(servconn->msg_passport);
 			g_free(servconn->msg_friendly);
 
+			msn_servconn_unqueue_message(servconn, entry->msg);
+
 			msn_message_destroy(msg);
 			entry->msg = NULL;
-
-			msn_servconn_unqueue_message(servconn, entry->msg);
 		}
 	}