diff src/aim.c @ 84:51943f1a97a0

[gaim-migrate @ 94] Changed how some of the applet away and callbacks work so that you can't open the buddy list or be away without signing on first. Also made it so you can't try to sign on *while* signing on, by clicking "signon" while already signing on. Apparently, this had caused segfaults and other bad things to happen to some people. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 05 Apr 2000 21:46:07 +0000
parents 05077cb276d4
children 2cae618a91e2
line wrap: on
line diff
--- a/src/aim.c	Wed Apr 05 09:20:25 2000 +0000
+++ b/src/aim.c	Wed Apr 05 21:46:07 2000 +0000
@@ -111,6 +111,7 @@
 
 void dologin(GtkWidget *widget, GtkWidget *w)
 {
+	static gboolean running = FALSE;
 	char *username = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(name)->entry));
         char *password = gtk_entry_get_text(GTK_ENTRY(pass));
 
@@ -131,11 +132,29 @@
 	setUserState(signing_on);
 #endif /* USE_APPLET */
 
+	if (running) return;
+	running = TRUE;
 
-        if (serv_login(username, password) < 0)
+        if (serv_login(username, password) < 0) {
+		running = FALSE;
                 return;
+	}
 
-        return;
+#ifdef USE_APPLET
+	 applet_widget_unregister_callback(APPLET_WIDGET(applet),"signon");
+	 applet_widget_register_callback(APPLET_WIDGET(applet),
+			 "buddy",
+			 _("Buddy List"),
+			 (AppletCallbackFunc)make_buddy,
+			 NULL);
+	 applet_widget_register_callback(APPLET_WIDGET(applet),
+			 "signoff",
+			 _("Signoff"),
+			 signoff,
+			 NULL);
+#endif
+	 running = FALSE;
+	 return;
 }