Index: protocols/jabber/jabber.c
===================================================================
--- protocols/jabber/jabber.c	(revision fbc78447e1e49b42cd1e8ba7e753f0635ec5e021)
+++ protocols/jabber/jabber.c	(revision 9cb9868256c51a45983aac894428230de6035d79)
@@ -2441,4 +2441,5 @@
 	ret->alias_buddy = jabber_roster_update;
 	ret->group_buddy = jabber_group_change;
+	ret->cmp_buddynames = g_strcasecmp;
 
 	my_protocol = ret;
Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision fbc78447e1e49b42cd1e8ba7e753f0635ec5e021)
+++ protocols/msn/msn.c	(revision 9cb9868256c51a45983aac894428230de6035d79)
@@ -398,4 +398,5 @@
 	ret->rem_deny = msn_rem_deny;
 	ret->send_typing = msn_send_typing;
+	ret->cmp_buddynames = g_strcasecmp;
 
 	my_protocol = ret;
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision fbc78447e1e49b42cd1e8ba7e753f0635ec5e021)
+++ protocols/nogaim.c	(revision 9cb9868256c51a45983aac894428230de6035d79)
@@ -162,42 +162,4 @@
 	return( NULL );
 }
-
-/* Compare two handles for a specific protocol. For most protocols,
-   g_strcasecmp is okay, but for AIM, for example, it's not. This really
-   should be a compare function inside the PRPL module, but I do it this
-   way for now because I don't want to touch the Gaim code too much since
-   it's not going to be here for too long anymore. */
-int handle_cmp( char *a, char *b, int protocol )
-{
-	if( protocol == PROTO_TOC || protocol == PROTO_ICQ )
-	{
-		/* AIM, being teh evil, thinks it's cool that users can put
-		   random spaces in screennames. But "A B" and "AB" are
-		   equal. Hrmm, okay. */
-		while( 1 )
-		{
-			while( *a == ' ' ) a ++;
-			while( *b == ' ' ) b ++;
-			
-			if( *a && *b )
-			{
-				if( tolower( *a ) != tolower( *b ) )
-					return( 1 );
-			}
-			else if( *a || *b )
-				return( 1 );
-			else
-				return( 0 );
-			
-			a ++;
-			b ++;
-		}
-	}
-	else
-	{
-		return( g_strcasecmp( a, b ) );
-	}
-}
-
 
 /* multi.c */
@@ -836,5 +798,5 @@
 	
 	/* It might be yourself! */
-	if( handle_cmp ( handle, b->gc->user->username, b->gc->protocol ) == 0 )
+	if( b->gc->prpl->cmp_buddynames( handle, b->gc->user->username ) == 0 )
 	{
 		u = user_find( b->gc->irc, b->gc->irc->nick );
Index: protocols/nogaim.h
===================================================================
--- protocols/nogaim.h	(revision fbc78447e1e49b42cd1e8ba7e753f0635ec5e021)
+++ protocols/nogaim.h	(revision 9cb9868256c51a45983aac894428230de6035d79)
@@ -220,4 +220,6 @@
 
 	char *(* get_status_string) (struct gaim_connection *gc, int stat);
+
+	int (* cmp_buddynames) (const char *who1, const char *who2);
 };
 
@@ -259,5 +261,4 @@
 int proto_away( struct gaim_connection *gc, char *away );
 char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value );
-int handle_cmp( char *a, char *b, int protocol );
 
 gboolean auto_reconnect( gpointer data );
Index: protocols/oscar/oscar.c
===================================================================
--- protocols/oscar/oscar.c	(revision fbc78447e1e49b42cd1e8ba7e753f0635ec5e021)
+++ protocols/oscar/oscar.c	(revision 9cb9868256c51a45983aac894428230de6035d79)
@@ -1210,9 +1210,5 @@
 	return 1;
 }
-/*
-int handle_cmp_aim(const char * a, const char * b) {
-	return handle_cmp(a, b, PROTO_TOC);
-}
-*/
+
 static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) {
 	int channel, ret = 0;
@@ -2486,4 +2482,5 @@
 	ret->set_permit_deny = oscar_set_permit_deny;
 	ret->keepalive = oscar_keepalive;
+	ret->cmp_buddynames = aim_sncmp;
 	ret->get_status_string = oscar_get_status_string;
 
Index: protocols/oscar/oscar_util.c
===================================================================
--- protocols/oscar/oscar_util.c	(revision fbc78447e1e49b42cd1e8ba7e753f0635ec5e021)
+++ protocols/oscar/oscar_util.c	(revision 9cb9868256c51a45983aac894428230de6035d79)
@@ -1,8 +1,2 @@
-/*
- *
- *
- *
- */
-
 #include <aim.h>
 #include <ctype.h>
Index: protocols/yahoo/yahoo.c
===================================================================
--- protocols/yahoo/yahoo.c	(revision fbc78447e1e49b42cd1e8ba7e753f0635ec5e021)
+++ protocols/yahoo/yahoo.c	(revision 9cb9868256c51a45983aac894428230de6035d79)
@@ -417,4 +417,5 @@
 	ret->chat_leave = byahoo_chat_leave;
 	ret->chat_open = byahoo_chat_open;
+	ret->cmp_buddynames = g_strcasecmp;
 	
 	my_protocol = ret;
