Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision 9b01339168bc79d08c4e371552cc44648bd8878d)
+++ protocols/msn/msn.c	(revision e0e15468835d5ae5bce54a28bd7a5b7aea66a1e2)
@@ -337,7 +337,4 @@
 	account_t *acc = set->data;
 	struct im_connection *ic = acc->ic;
-	struct msn_data *md = ic->proto_data;
-	char buf[512];
-	char *fn;
 	
 	if( strlen( value ) > 129 )
@@ -348,15 +345,5 @@
 	
 	msn_soap_addressbook_set_display_name( ic, value );
-
-	fn = g_malloc( strlen( value ) * 3 + 1 );
-	strcpy( fn, value );
-	http_encode( fn );
-	g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n",
-	            ++md->trId, fn );
-	g_free( fn );
-	
-	/* Note: We don't actually know if the server accepted the new name,
-	   and won't give proper feedback yet if it doesn't. */
-	return msn_write( ic, buf, strlen( buf ) ) ? value : NULL;
+	return msn_ns_set_display_name( ic, value ) ? value : NULL;
 }
 
Index: protocols/msn/msn.h
===================================================================
--- protocols/msn/msn.h	(revision 9b01339168bc79d08c4e371552cc44648bd8878d)
+++ protocols/msn/msn.h	(revision e0e15468835d5ae5bce54a28bd7a5b7aea66a1e2)
@@ -217,9 +217,9 @@
 int msn_handler( struct msn_handler_data *h );
 void msn_msgq_purge( struct im_connection *ic, GSList **list );
-gboolean msn_set_display_name( struct im_connection *ic, const char *rawname );
 char *msn_p11_challenge( char *challenge );
 gint msn_domaintree_cmp( gconstpointer a_, gconstpointer b_ );
 struct msn_group *msn_group_by_name( struct im_connection *ic, const char *name );
 struct msn_group *msn_group_by_id( struct im_connection *ic, const char *id );
+int msn_ns_set_display_name( struct im_connection *ic, const char *value );
 
 /* tables.c */
Index: protocols/msn/msn_util.c
===================================================================
--- protocols/msn/msn_util.c	(revision 9b01339168bc79d08c4e371552cc44648bd8878d)
+++ protocols/msn/msn_util.c	(revision e0e15468835d5ae5bce54a28bd7a5b7aea66a1e2)
@@ -598,2 +598,18 @@
 	return NULL;
 }
+
+int msn_ns_set_display_name( struct im_connection *ic, const char *value )
+{
+	struct msn_data *md = ic->proto_data;
+	char fn[strlen(value)*3+1];
+	char buf[512];
+	
+	strcpy( fn, value );
+	http_encode( fn );
+	g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n",
+	            ++md->trId, fn );
+	
+	/* Note: We don't actually know if the server accepted the new name,
+	   and won't give proper feedback yet if it doesn't. */
+	return msn_write( ic, buf, strlen( buf ) );
+}
Index: protocols/msn/ns.c
===================================================================
--- protocols/msn/ns.c	(revision 9b01339168bc79d08c4e371552cc44648bd8878d)
+++ protocols/msn/ns.c	(revision e0e15468835d5ae5bce54a28bd7a5b7aea66a1e2)
@@ -259,4 +259,7 @@
 	{
 		msn_ns_send_adl_start( ic );
+		
+		if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) )
+			return msn_ns_set_display_name( ic, set_getstr( &ic->acc->set, "display_name" ) );
 	}
 	else if( strcmp( cmd[0], "ADL" ) == 0 )
@@ -268,19 +271,8 @@
 			if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) )
 			{
-				char buf[1024];
-				char *fn_raw;
-				char *fn;
-				
-				if( ( fn_raw = set_getstr( &ic->acc->set, "display_name" ) ) == NULL )
-					fn_raw = ic->acc->user;
-				fn = g_malloc( strlen( fn_raw ) * 3 + 1 );
-				strcpy( fn, fn_raw );
-				http_encode( fn );
-				
-				g_snprintf( buf, sizeof( buf ), "PRP %d MFN %s\r\n",
-				            ++md->trId, fn );
-				g_free( fn );
-				
-				msn_write( ic, buf, strlen( buf ) );
+				msn_ns_send_adl( ic );
+				
+				if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) )
+					return msn_ns_set_display_name( ic, set_getstr( &ic->acc->set, "display_name" ) );
 			}
 		}
Index: protocols/msn/soap.c
===================================================================
--- protocols/msn/soap.c	(revision 9b01339168bc79d08c4e371552cc44648bd8878d)
+++ protocols/msn/soap.c	(revision e0e15468835d5ae5bce54a28bd7a5b7aea66a1e2)
@@ -687,4 +687,5 @@
 	struct msn_soap_req_data *soap_req = data;
 	struct im_connection *ic = soap_req->ic;
+	struct msn_data *md = soap_req->ic->proto_data;
 	struct msn_group *group;
 	
@@ -704,4 +705,8 @@
 	if( type && g_strcasecmp( type, "me" ) == 0 )
 	{
+#if 0
+		g_free( md->myid );
+		md->myid = g_strdup( id );
+#endif		
 		set_t *set = set_find( &ic->acc->set, "display_name" );
 		g_free( set->value );
@@ -766,5 +771,5 @@
 	soap_req->action = g_strdup( SOAP_AB_NAMECHANGE_ACTION );
 	soap_req->payload = msn_soap_abservice_build( SOAP_AB_NAMECHANGE_PAYLOAD,
-		"Initial", md->tokens[1], (char *) soap_req->data );
+		"Timer", md->tokens[1], (char *) soap_req->data );
 	
 	return 1;
