Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 0da65d5fb37691ed4d31f7ab4058732f1440db6b)
+++ protocols/nogaim.c	(revision aef4828a1dc51de10a43bb7dd5d023de9971295b)
@@ -145,5 +145,5 @@
 /* multi.c */
 
-struct im_connection *new_gaim_conn( account_t *acc )
+struct im_connection *imc_new( account_t *acc )
 {
 	struct im_connection *ic;
@@ -164,5 +164,5 @@
 }
 
-void destroy_gaim_conn( struct im_connection *ic )
+void imc_free( struct im_connection *ic )
 {
 	account_t *a;
@@ -180,22 +180,5 @@
 }
 
-void set_login_progress( struct im_connection *ic, int step, char *msg )
-{
-	serv_got_crap( ic, "Logging in: %s", msg );
-}
-
-/* Errors *while* logging in */
-void hide_login_progress( struct im_connection *ic, char *msg )
-{
-	serv_got_crap( ic, "Login error: %s", msg );
-}
-
-/* Errors *after* logging in */
-void hide_login_progress_error( struct im_connection *ic, char *msg )
-{
-	serv_got_crap( ic, "Logged out: %s", msg );
-}
-
-void serv_got_crap( struct im_connection *ic, char *format, ... )
+static void serv_got_crap( struct im_connection *ic, char *format, ... )
 {
 	va_list params;
@@ -225,4 +208,38 @@
 }
 
+void imc_log( struct im_connection *ic, char *format, ... )
+{
+	va_list params;
+	char *text;
+	
+	va_start( params, format );
+	text = g_strdup_vprintf( format, params );
+	va_end( params );
+	
+	if( ic->flags & OPT_LOGGED_IN )
+		serv_got_crap( ic, "%s", text );
+	else
+		serv_got_crap( ic, "Logging in: %s", text );
+	
+	g_free( text );
+}
+
+void imc_error( struct im_connection *ic, char *format, ... )
+{
+	va_list params;
+	char *text;
+	
+	va_start( params, format );
+	text = g_strdup_vprintf( format, params );
+	va_end( params );
+	
+	if( ic->flags & OPT_LOGGED_IN )
+		serv_got_crap( ic, "Error: %s", text );
+	else
+		serv_got_crap( ic, "Couldn't log in: %s", text );
+	
+	g_free( text );
+}
+
 static gboolean send_keepalive( gpointer d, gint fd, b_input_condition cond )
 {
@@ -235,5 +252,5 @@
 }
 
-void account_online( struct im_connection *ic )
+void imc_connected( struct im_connection *ic )
 {
 	user_t *u;
@@ -247,5 +264,5 @@
 	u = user_find( ic->irc, ic->irc->nick );
 	
-	serv_got_crap( ic, "Logged in" );
+	imc_log( ic, "Logged in" );
 	
 	ic->keepalive = b_timeout_add( 60000, send_keepalive, ic );
@@ -274,5 +291,5 @@
 }
 
-void signoff( struct im_connection *ic )
+void imc_logout( struct im_connection *ic )
 {
 	irc_t *irc = ic->irc;
@@ -287,5 +304,5 @@
 		ic->flags |= OPT_LOGGING_OUT;
 	
-	serv_got_crap( ic, "Signing off.." );
+	imc_log( ic, "Signing off.." );
 	
 	b_event_remove( ic->keepalive );
@@ -321,25 +338,13 @@
 		int delay = set_getint( &irc->set, "auto_reconnect_delay" );
 		
-		serv_got_crap( ic, "Reconnecting in %d seconds..", delay );
+		imc_log( ic, "Reconnecting in %d seconds..", delay );
 		a->reconnect = b_timeout_add( delay * 1000, auto_reconnect, a );
 	}
 	
-	destroy_gaim_conn( ic );
+	imc_free( ic );
 }
 
 
 /* dialogs.c */
-
-void do_error_dialog( struct im_connection *ic, char *msg, char *title )
-{
-	if( msg && title )
-		serv_got_crap( ic, "Error: %s: %s", title, msg );
-	else if( msg )
-		serv_got_crap( ic, "Error: %s", msg );
-	else if( title )
-		serv_got_crap( ic, "Error: %s", title );
-	else
-		serv_got_crap( ic, "Error" );
-}
 
 void do_ask_dialog( struct im_connection *ic, char *msg, void *data, void *doit, void *dont )
@@ -359,10 +364,10 @@
 	
 	if( set_getbool( &irc->set, "debug" ) && 0 ) /* This message is too useless */
-		serv_got_crap( ic, "Receiving user add from handle: %s", handle );
+		imc_log( ic, "Receiving user add from handle: %s", handle );
 	
 	if( user_findhandle( ic, handle ) )
 	{
 		if( set_getbool( &irc->set, "debug" ) )
-			serv_got_crap( ic, "User already exists, ignoring add request: %s", handle );
+			imc_log( ic, "User already exists, ignoring add request: %s", handle );
 		
 		return;
@@ -452,5 +457,5 @@
 		
 		if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->set, "display_namechanges" ) )
-			serv_got_crap( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
+			imc_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
 	}
 }
@@ -516,6 +521,6 @@
 			if( set_getbool( &ic->irc->set, "debug" ) || g_strcasecmp( set_getstr( &ic->irc->set, "handle_unknown" ), "ignore" ) != 0 )
 			{
-				serv_got_crap( ic, "serv_got_update() for handle %s:", handle );
-				serv_got_crap( ic, "loggedin = %d, type = %d", loggedin, type );
+				imc_log( ic, "serv_got_update() for handle %s:", handle );
+				imc_log( ic, "loggedin = %d, type = %d", loggedin, type );
 			}
 			
@@ -597,5 +602,5 @@
 		{
 			if( set_getbool( &irc->set, "debug" ) )
-				serv_got_crap( ic, "Ignoring message from unknown handle %s", handle );
+				imc_log( ic, "Ignoring message from unknown handle %s", handle );
 			
 			return;
@@ -619,5 +624,5 @@
 		else
 		{
-			serv_got_crap( ic, "Message from unknown handle %s:", handle );
+			imc_log( ic, "Message from unknown handle %s:", handle );
 			u = user_find( irc, irc->mynick );
 		}
@@ -689,5 +694,5 @@
 	
 	if( set_getbool( &ic->irc->set, "debug" ) )
-		serv_got_crap( ic, "You were removed from conversation 0x%x", (int) c );
+		imc_log( ic, "You were removed from conversation 0x%x", (int) c );
 	
 	if( c )
@@ -737,5 +742,5 @@
 		irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, "", msg );
 	else
-		serv_got_crap( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );
+		imc_log( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );
 }
 
@@ -759,5 +764,5 @@
 	
 	if( set_getbool( &ic->irc->set, "debug" ) )
-		serv_got_crap( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );
+		imc_log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );
 	
 	return c;
@@ -773,5 +778,5 @@
 	
 	if( set_getbool( &b->ic->irc->set, "debug" ) )
-		serv_got_crap( b->ic, "User %s added to conversation 0x%x", handle, (int) b );
+		imc_log( b->ic, "User %s added to conversation 0x%x", handle, (int) b );
 	
 	/* It might be yourself! */
@@ -807,5 +812,5 @@
 	
 	if( set_getbool( &b->ic->irc->set, "debug" ) )
-		serv_got_crap( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );
+		imc_log( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );
 	
 	/* It might be yourself! */
@@ -1005,5 +1010,5 @@
 			ic->acc->prpl->set_away( ic, s, away );
 			if( set_getbool( &ic->irc->set, "debug" ) )
-				serv_got_crap( ic, "Setting away state to %s", s );
+				imc_log( ic, "Setting away state to %s", s );
 		}
 		else
