Changeset 4107fea
- Timestamp:
- 2015-05-31T02:40:04Z (10 years ago)
- Children:
- ef9ee0e
- Parents:
- 85dabae
- git-author:
- dequis <dx@…> (18-04-15 22:09:46)
- git-committer:
- dequis <dx@…> (31-05-15 02:40:04)
- Location:
- protocols/msn
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/msn/gw.c
r85dabae r4107fea 154 154 void msn_gw_open(struct msn_gw *gw) 155 155 { 156 msn_gw_dorequest(gw, "Action=open&Server=NS ");156 msn_gw_dorequest(gw, "Action=open&Server=NS&Protocol=mtp&Version=1"); 157 157 } 158 158 -
protocols/msn/msn.c
r85dabae r4107fea 76 76 md->domaintree = g_tree_new(msn_domaintree_cmp); 77 77 md->fd = -1; 78 md->is_http = TRUE;78 md->is_http = FALSE; 79 79 80 80 msn_connections = g_slist_prepend(msn_connections, ic); -
protocols/msn/ns.c
r85dabae r4107fea 56 56 57 57 if (getenv("BITLBEE_DEBUG")) { 58 fprintf(stderr, "\ x1b[91m>>>[NS] %s\n\x1b[97m", out);58 fprintf(stderr, "\n\x1b[91m>>>[NS] %s\n\x1b[97m", out); 59 59 } 60 60 … … 148 148 } 149 149 150 if (msn_ns_write (ic, "VER %d %s CVR0\r\n", ++md->trId, MSNP_VER)) {150 if (msn_ns_write_cmd(ic, "CNT", "CON", "<connect><ver>2</ver><agent><os>winnt</os><osVer>5.2</osVer><proc>x86</proc><lcid>en-us</lcid></agent></connect>")) { 151 151 if (!md->is_http) { 152 152 md->inpa = b_input_add(md->fd, B_EV_IO_READ, msn_ns_callback, md); … … 215 215 { 216 216 struct im_connection *ic = md->ic; 217 218 if (num_parts == 0) { 219 /* Hrrm... Empty command...? Ignore? */ 220 return(1); 221 } 222 223 if (strcmp(cmd[0], "VER") == 0) { 224 if (cmd[2] && strncmp(cmd[2], MSNP_VER, 5) != 0) { 225 imcb_error(ic, "Unsupported protocol"); 226 imc_logout(ic, FALSE); 227 return(0); 228 } 229 230 return(msn_ns_write(ic, "CVR %d 0x0409 mac 10.2.0 ppc macmsgs 3.5.1 macmsgs %s VmVyc2lvbjogMQ0KWGZyQ291bnQ6IDINClhmclNlbnRVVENUaW1lOiA2MzU2MTQ3OTU5NzgzOTAwMDANCklzR2VvWGZyOiB0cnVlDQo=\r\n", 231 ++md->trId, ic->acc->user)); 232 } else if (strcmp(cmd[0], "CVR") == 0) { 233 /* We don't give a damn about the information we just received */ 234 return msn_ns_write(ic, "USR %d SSO I %s\r\n", ++md->trId, ic->acc->user); 235 } else if (strcmp(cmd[0], "XFR") == 0) { 236 char *server; 237 int port; 238 239 if (num_parts >= 6 && strcmp(cmd[2], "NS") == 0) { 240 b_event_remove(md->inpa); 241 md->inpa = -1; 242 243 server = strchr(cmd[3], ':'); 244 if (!server) { 245 imcb_error(ic, "Syntax error"); 246 imc_logout(ic, TRUE); 247 return(0); 248 } 249 *server = 0; 250 port = atoi(server + 1); 251 server = cmd[3]; 252 253 imcb_log(ic, "Transferring to other server"); 254 return msn_ns_connect(ic, server, port); 255 } else { 256 imcb_error(ic, "Syntax error"); 257 imc_logout(ic, TRUE); 258 return(0); 259 } 260 } else if (strcmp(cmd[0], "USR") == 0) { 261 if (num_parts >= 6 && strcmp(cmd[2], "SSO") == 0 && 262 strcmp(cmd[3], "S") == 0) { 263 g_free(md->pp_policy); 264 md->pp_policy = g_strdup(cmd[4]); 265 msn_soap_passport_sso_request(ic, cmd[5]); 266 } else if (strcmp(cmd[2], "OK") == 0) { 267 /* If the number after the handle is 0, the e-mail 268 address is unverified, which means we can't change 269 the display name. */ 270 if (cmd[4][0] == '0') { 271 md->flags |= MSN_EMAIL_UNVERIFIED; 272 } 273 274 imcb_log(ic, "Authenticated, getting buddy list"); 275 msn_soap_memlist_request(ic); 276 } else { 277 imcb_error(ic, "Unknown authentication type"); 278 imc_logout(ic, FALSE); 279 return(0); 280 } 217 struct xt_node *xml; 218 219 if (strcmp(cmd[0], "XFR") == 0) { 220 struct xt_node *target; 221 char *server, *p; 222 int port, st; 223 224 if (!(xml = xt_from_string(msg + 2, msglen - 2)) || 225 !(target = xt_find_node(xml->children, "target")) || 226 !(server = target->text) || 227 !(p = strchr(server, ':'))) { 228 return 1; 229 } 230 231 server = target->text; 232 *p = 0; 233 port = atoi(p + 1); 234 235 b_event_remove(md->inpa); 236 md->inpa = -1; 237 238 imcb_log(ic, "Transferring to other server"); 239 240 st = msn_ns_connect(ic, server, port); 241 242 xt_free_node(xml); 243 244 return st; 245 246 } else if (strcmp(cmd[0], "CNT") == 0) { 247 msn_soap_passport_sso_request(ic); 248 249 /* continues in msn_auth_got_passport_token */ 250 251 } else if (strcmp(cmd[0], "ATH") == 0) { 252 char *payload; 253 254 payload = g_markup_printf_escaped( 255 "<msgr><ver>1</ver><client><name>Skype</name><ver>2/4.3.0.37/174</ver></client>" 256 "<epid>%s</epid></msgr>\r\n", 257 md->uuid); 258 259 msn_ns_write_cmd(ic, "BND", "CON\\MSGR", payload); 260 261 g_free(payload); 262 263 } else if (strcmp(cmd[0], "BND") == 0) { 264 imcb_log(ic, "Authenticated, getting buddy list"); 265 msn_soap_memlist_request(ic); 266 281 267 } else if (strcmp(cmd[0], "ADL") == 0) { 282 268 if (num_parts >= 3 && strcmp(cmd[2], "OK") == 0) { … … 562 548 { 563 549 struct msn_data *md; 550 char *payload = NULL; 564 551 565 552 /* Dead connection? */ … … 570 557 md = ic->proto_data; 571 558 572 if (token) { 573 msn_ns_write(ic, "USR %d SSO S %s %s {%s}\r\n", ++md->trId, md->tokens[0], token, md->uuid); 574 } else { 559 if (!token) { 575 560 imcb_error(ic, "Error during Passport authentication: %s", error); 576 561 imc_logout(ic, TRUE); 577 562 } 563 564 // ATH 565 payload = g_markup_printf_escaped( 566 "<user><ssl-compact-ticket>%s</ssl-compact-ticket>" 567 "<ssl-site-name>chatservice.live.com</ssl-site-name></user>", 568 md->tokens[0]); 569 570 msn_ns_write_cmd(ic, "ATH", "CON\\USER", payload); 571 572 g_free(payload); 573 574 /* continues in msn_ns_command */ 578 575 } 579 576
Note: See TracChangeset
for help on using the changeset viewer.