Changeset 4aa8a04 for protocols/msn
- Timestamp:
- 2010-09-04T15:54:52Z (14 years ago)
- Branches:
- master
- Children:
- 27053b5
- Parents:
- bae0617
- Location:
- protocols/msn
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/msn.c
rbae0617 r4aa8a04 64 64 md->away_state = msn_away_state_list; 65 65 md->domaintree = g_tree_new( msn_domaintree_cmp ); 66 md->ns->fd = md->auth->fd = -1; 66 67 67 68 msn_connections = g_slist_prepend( msn_connections, ic ); … … 180 181 struct msn_data *md = ic->proto_data; 181 182 183 strcpy( md->tokens[1], md->tokens[2] ); 184 182 185 if( state == NULL ) 183 186 md->away_state = msn_away_state_list; … … 281 284 static void msn_rem_permit( struct im_connection *ic, char *who ) 282 285 { 283 msn_buddy_list_remove( ic, MSN_BUDDY_AL, who, NULL );286 //msn_buddy_list_remove( ic, MSN_BUDDY_AL, who, NULL ); 284 287 } 285 288 … … 299 302 static void msn_rem_deny( struct im_connection *ic, char *who ) 300 303 { 301 msn_buddy_list_remove( ic, MSN_BUDDY_BL, who, NULL );304 //msn_buddy_list_remove( ic, MSN_BUDDY_BL, who, NULL ); 302 305 } 303 306 -
protocols/msn/msn.h
rbae0617 r4aa8a04 108 108 int trId; 109 109 char *tokens[4]; 110 char *lock_key ;111 112 GSList *msgq, *grpq ;110 char *lock_key, *pp_policy; 111 112 GSList *msgq, *grpq, *soapq; 113 113 GSList *switchboards; 114 114 int sb_failures; -
protocols/msn/ns.c
rbae0617 r4aa8a04 111 111 handler->rxq = g_new0( char, 1 ); 112 112 113 if( msn_ns_write( ic, -1, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER ) )113 if( msn_ns_write( ic, source, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER ) ) 114 114 { 115 115 handler->inpa = b_input_add( handler->fd, B_EV_IO_READ, msn_ns_callback, handler ); … … 173 173 } 174 174 175 return( msn_ns_write( ic, -1, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s\r\n",175 return( msn_ns_write( ic, handler->fd, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s\r\n", 176 176 ++md->trId, ic->acc->user ) ); 177 177 } … … 179 179 { 180 180 /* We don't give a damn about the information we just received */ 181 return msn_ns_write( ic, -1, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user );181 return msn_ns_write( ic, handler->fd, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user ); 182 182 } 183 183 else if( strcmp( cmd[0], "XFR" ) == 0 ) … … 272 272 strcmp( cmd[3], "S" ) == 0 ) 273 273 { 274 msn_soap_passport_sso_request( ic, cmd[4], cmd[5] ); 274 g_free( md->pp_policy ); 275 md->pp_policy = g_strdup( cmd[4] ); 276 msn_soap_passport_sso_request( ic, cmd[5] ); 277 if( handler == md->auth ) 278 { 279 msn_ns_close( md->auth ); 280 return 0; 281 } 275 282 } 276 283 else if( strcmp( cmd[2], "OK" ) == 0 ) -
protocols/msn/soap.c
rbae0617 r4aa8a04 137 137 { 138 138 struct xt_parser *parser; 139 struct xt_node *err; 139 140 140 141 parser = xt_new( soap_req->xml_parser, soap_req ); 141 142 xt_feed( parser, http_req->reply_body, http_req->body_size ); 143 if( http_req->status_code == 500 && 144 ( err = xt_find_path( parser->root, "soap:Body/soap:Fault/detail/errorcode" ) ) && 145 err->text_len > 0 && strcmp( err->text, "PassportAuthFail" ) == 0 ) 146 { 147 struct msn_data *md = soap_req->ic->proto_data; 148 149 xt_free( parser ); 150 if( md->auth->fd == -1 ) 151 msn_ns_connect( soap_req->ic, md->auth, MSN_NS_HOST, MSN_NS_PORT ); 152 md->soapq = g_slist_prepend( md->soapq, soap_req ); 153 154 return; 155 } 156 142 157 xt_handle( parser, NULL, -1 ); 143 158 xt_free( parser ); … … 202 217 } 203 218 219 static int msn_soapq_empty( struct im_connection *ic ) 220 { 221 struct msn_data *md = ic->proto_data; 222 223 while( md->soapq ) 224 { 225 msn_soap_send_request( (struct msn_soap_req_data*) md->soapq->data ); 226 md->soapq = g_slist_remove( md->soapq, md->soapq->data ); 227 } 228 229 return MSN_SOAP_OK; 230 } 231 204 232 205 233 /* passport_sso: Authentication MSNP15+ */ … … 207 235 struct msn_soap_passport_sso_data 208 236 { 209 char *policy;210 237 char *nonce; 211 238 char *secret; … … 217 244 struct msn_soap_passport_sso_data *sd = soap_req->data; 218 245 struct im_connection *ic = soap_req->ic; 246 struct msn_data *md = ic->proto_data; 219 247 220 248 if( g_str_has_suffix( ic->acc->user, "@msn.com" ) ) … … 224 252 225 253 soap_req->payload = g_markup_printf_escaped( SOAP_PASSPORT_SSO_PAYLOAD, 226 ic->acc->user, ic->acc->pass, sd->policy );254 ic->acc->user, ic->acc->pass, md->pp_policy ); 227 255 228 256 return MSN_SOAP_OK; … … 301 329 struct msn_soap_passport_sso_data *sd = soap_req->data; 302 330 struct im_connection *ic = soap_req->ic; 331 struct msn_data *md = ic->proto_data; 303 332 char *key1, *key2, *key3, *blurb64; 304 333 int key1_len; … … 326 355 }; 327 356 357 if( md->soapq ) 358 return msn_soapq_empty( ic ); 359 328 360 if( sd->secret == NULL ) 329 361 { … … 364 396 struct msn_soap_passport_sso_data *sd = soap_req->data; 365 397 366 g_free( sd->policy );367 398 g_free( sd->nonce ); 368 399 g_free( sd->secret ); … … 372 403 } 373 404 374 int msn_soap_passport_sso_request( struct im_connection *ic, const char * policy, const char *nonce )405 int msn_soap_passport_sso_request( struct im_connection *ic, const char *nonce ) 375 406 { 376 407 struct msn_soap_passport_sso_data *sd = g_new0( struct msn_soap_passport_sso_data, 1 ); 377 408 378 sd->policy = g_strdup( policy );379 409 sd->nonce = g_strdup( nonce ); 380 410 -
protocols/msn/soap.h
rbae0617 r4aa8a04 139 139 "</Envelope>" 140 140 141 int msn_soap_passport_sso_request( struct im_connection *ic, const char * policy, const char *nonce );141 int msn_soap_passport_sso_request( struct im_connection *ic, const char *nonce ); 142 142 143 143
Note: See TracChangeset
for help on using the changeset viewer.