diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-09-03 22:24:58 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-09-03 22:24:58 +0100 |
commit | bae06178bbe3863b39ec307c34d2781a53472272 (patch) | |
tree | 53f8cd8b8d2bc0b2da26356fa604a37b4368971e /protocols/msn/msn.c | |
parent | 64768d4ec0c3ad473573c3f3c34871e0081b4e59 (diff) |
Rearrange things a bit to support multiple NS connections. This is apparently
needed for refreshing auth. tokens.
Diffstat (limited to 'protocols/msn/msn.c')
-rw-r--r-- | protocols/msn/msn.c | 27 |
1 files changed, 6 insertions, 21 deletions
diff --git a/protocols/msn/msn.c b/protocols/msn/msn.c index f37b802e..c5c05087 100644 --- a/protocols/msn/msn.c +++ b/protocols/msn/msn.c @@ -52,7 +52,6 @@ static void msn_login( account_t *acc ) struct msn_data *md = g_new0( struct msn_data, 1 ); ic->proto_data = md; - md->fd = -1; if( strchr( acc->user, '@' ) == NULL ) { @@ -61,21 +60,14 @@ static void msn_login( account_t *acc ) return; } - imcb_log( ic, "Connecting" ); - - md->fd = proxy_connect( "messenger.hotmail.com", 1863, msn_ns_connected, ic ); - if( md->fd < 0 ) - { - imcb_error( ic, "Could not connect to server" ); - imc_logout( ic, TRUE ); - return; - } - md->ic = ic; md->away_state = msn_away_state_list; md->domaintree = g_tree_new( msn_domaintree_cmp ); - msn_connections = g_slist_append( msn_connections, ic ); + msn_connections = g_slist_prepend( msn_connections, ic ); + + imcb_log( ic, "Connecting" ); + msn_ns_connect( ic, md->ns, MSN_NS_HOST, MSN_NS_PORT ); } static void msn_logout( struct im_connection *ic ) @@ -92,15 +84,8 @@ static void msn_logout( struct im_connection *ic ) } */ - if( md->fd >= 0 ) - closesocket( md->fd ); - - if( md->handler ) - { - if( md->handler->rxq ) g_free( md->handler->rxq ); - if( md->handler->cmd_text ) g_free( md->handler->cmd_text ); - g_free( md->handler ); - } + msn_ns_close( md->ns ); + msn_ns_close( md->auth ); while( md->switchboards ) msn_sb_destroy( md->switchboards->data ); |