--- commands.c	Tue Feb  8 22:48:35 2005
+++ commands.c	Thu Oct 20 15:01:59 2005
@@ -474,6 +474,7 @@
 	s = g_strdup( u->handle );
 	
 	u->gc->prpl->remove_buddy( u->gc, u->handle, NULL );
+	irc_part( irc, u, irc->channel );
 	user_del( irc, cmd[1] );
 	nick_del( irc, cmd[1] );
 	
--- irc.c	Thu Feb 24 00:32:02 2005
+++ irc.c	Sun Oct 16 05:30:47 2005
@@ -944,30 +944,31 @@
 	
 	if( control || c ) while( u )
 	{
-		if( u->online )
+		if( u->gc && control )
 		{
-			if( u->gc && control )
-			{
+			if (u->online) {
 				if( set_getint( irc, "away_devoice" ) && !u->away )
-					s = "+";
-				else
-					s = "";
-				
-				irc_reply( irc, 353, "@ %s :%s%s", channel, s, u->nick );
-			}
-			else if( !u->gc )
-			{
-				if( strcmp( u->nick, irc->mynick ) == 0 && ( strcmp( set_getstr( irc, "ops" ), "root" ) == 0 || strcmp( set_getstr( irc, "ops" ), "both" ) == 0 ) )
-					s = "@";
-				else if( strcmp( u->nick, irc->nick ) == 0 && ( strcmp( set_getstr( irc, "ops" ), "user" ) == 0 || strcmp( set_getstr( irc, "ops" ), "both" ) == 0 ) )
 					s = "@";
 				else
-					s = "";
-				
-				irc_reply( irc, 353, "@ %s :%s%s", channel, s, u->nick );
+					s = "+";
 			}
+			else {
+				s = "";
+			}
+			
+			irc_reply( irc, 353, "@ %s :%s%s", channel, s, u->nick );
+		}
+		else if( !u->gc )
+		{
+			if( strcmp( u->nick, irc->mynick ) == 0 && ( strcmp( set_getstr( irc, "ops" ), "root" ) == 0 || strcmp( set_getstr( irc, "ops" ), "both" ) == 0 ) )
+				s = "@";
+			else if( strcmp( u->nick, irc->nick ) == 0 && ( strcmp( set_getstr( irc, "ops" ), "user" ) == 0 || strcmp( set_getstr( irc, "ops" ), "both" ) == 0 ) )
+				s = "@";
+			else
+				s = "";
+			
+			irc_reply( irc, 353, "@ %s :%s%s", channel, s, u->nick );
 		}
-		
 		u = u->next;
 	}
 	
@@ -1262,7 +1263,9 @@
 {
 	char *nick;
 	
-	irc_write( irc, ":%s!%s@%s QUIT :%s", u->nick, u->user, u->host, "Leaving..." );
+	if (!(u->gc->dying)) {
+		irc_write( irc, ":%s!%s@%s MODE %s -vo %s %s", irc->mynick, irc->mynick, irc->myhost, irc->channel, u->nick, u->nick);
+	}
 	
 	nick = g_strdup( u->nick );
 	nick_lc( nick );
--- protocols/nogaim.c	Wed Feb 23 16:47:58 2005
+++ protocols/nogaim.c	Sun Oct 16 15:47:30 2005
@@ -357,7 +357,7 @@
 	account_t *a;
 	
 	irc_usermsg( gc->irc, "%s - Signing off..", proto_name[gc->protocol] );
-
+	gc->dying = 1;
 	gaim_input_remove( gc->keepalive );
 	gc->keepalive = 0;
 	gc->prpl->close( gc );
@@ -368,6 +368,7 @@
 		if( u->gc == gc )
 		{
 			t = u->next;
+			irc_write( irc, ":%s!%s@%s QUIT :%s", u->nick, u->user, u->host, "leaving");
 			user_del( irc, u->nick );
 			u = t;
 		}
@@ -430,7 +431,7 @@
 	char *s;
 	irc_t *irc = gc->irc;
 	
-	if( set_getint( irc, "debug" ) && 0 ) /* This message is too useless */
+	if( set_getint( irc, "debug" )) /* This message is too useless */
 		irc_usermsg( irc, "Receiving user add from protocol: %s", handle );
 	
 	if( user_findhandle( gc, handle ) )
@@ -476,6 +477,7 @@
 	u->handle = g_strdup( handle );
 	u->send_handler = buddy_send_handler;
 	u->last_typing_notice = 0;
+	irc_write(irc, ":%s!%s@%s JOIN :%s", u->nick, u->user, u->host, u->gc->irc->channel);
 }
 
 struct buddy *find_buddy( struct gaim_connection *gc, char *handle )
@@ -582,7 +584,6 @@
 	
 	if( loggedin && !u->online )
 	{
-		irc_spawn( gc->irc, u );
 		u->online = 1;
 	}
 	else if( !loggedin && u->online )
@@ -620,11 +621,10 @@
 	/* LISPy... */
 	if( ( set_getint( gc->irc, "away_devoice" ) ) &&		/* Don't do a thing when user doesn't want it */
 	    ( u->online ) &&						/* Don't touch offline people */
-	    ( ( ( u->online != oo ) && !u->away ) ||			/* Voice joining people */
+	    ( ( ( u->online != oo )) ||			/* Voice joining people */
 	      ( ( u->online == oo ) && ( oa == !u->away ) ) ) )		/* (De)voice people changing state */
 	{
-		irc_write( gc->irc, ":%s!%s@%s MODE %s %cv %s", gc->irc->mynick, gc->irc->mynick, gc->irc->myhost,
-		                                                gc->irc->channel, u->away?'-':'+', u->nick );
+		irc_write( gc->irc, ":%s!%s@%s MODE %s %cv%co %s %s", gc->irc->mynick, gc->irc->mynick, gc->irc->myhost, gc->irc->channel, u->away?'+':'-', u->away?'-':'+', u->nick, u->nick );
 	}
 }
 
--- protocols/nogaim.h	Sat Oct 30 01:42:07 2004
+++ protocols/nogaim.h	Sun Oct 16 05:04:31 2005
@@ -106,6 +106,7 @@
 	int is_auto_away;
 	
 	int evil;
+	gboolean dying;
 	gboolean wants_to_die; /* defaults to FALSE */
 	
 	/* BitlBee */
