src/protocols/msn/notification.c

changeset 10010
d9ee01f0659a
parent 9967
7400b348ff62
child 10043
4d4cc1ee9b69
equal deleted inserted replaced
10009:8a4fcc043f47 10010:d9ee01f0659a
447 } 447 }
448 448
449 static void 449 static void
450 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) 450 fln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
451 { 451 {
452 GaimConnection *gc; 452 GaimAccount *account;
453 453
454 gc = cmdproc->session->account->gc; 454 account = cmdproc->session->account;
455 455
456 serv_got_update(gc, cmd->params[0], FALSE, 0); 456 gaim_prpl_got_user_status(account, cmd->params[0], "offline", NULL);
457 } 457 }
458 458
459 /*
460 * XXX - There is a bit of code duplication between this function
461 * and nln_cmd. Someone should do something about that.
462 */
459 static void 463 static void
460 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) 464 iln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
461 { 465 {
462 MsnSession *session; 466 MsnSession *session;
467 GaimAccount *account;
463 GaimConnection *gc; 468 GaimConnection *gc;
464 MsnUser *user; 469 MsnUser *user;
465 MsnObject *msnobj; 470 MsnObject *msnobj;
466 const char *status, *state, *passport, *friendly; 471 const char *status, *state, *passport, *friendly;
467 472
468 session = cmdproc->session; 473 session = cmdproc->session;
469 gc = session->account->gc; 474 account = session->account;
475 gc = gaim_account_get_connection(account);
470 476
471 state = cmd->params[1]; 477 state = cmd->params[1];
472 passport = cmd->params[2]; 478 passport = cmd->params[2];
473 friendly = gaim_url_decode(cmd->params[3]); 479 friendly = gaim_url_decode(cmd->params[3]);
474 480
483 { 489 {
484 msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[5])); 490 msnobj = msn_object_new_from_string(gaim_url_decode(cmd->params[5]));
485 msn_user_set_object(user, msnobj); 491 msn_user_set_object(user, msnobj);
486 } 492 }
487 493
488 /* what does this do????? 494 /* XXX - What does this do?????
489 if ((b = gaim_find_buddy(gc->account, passport)) != NULL) 495 if ((b = gaim_find_buddy(account, passport)) != NULL)
490 status |= ((((b->uc) >> 1) & 0xF0) << 1); */ 496 status |= ((((b->uc) >> 1) & 0xF0) << 1);
497 */
491 498
492 if (!g_ascii_strcasecmp(state, "BSY")) 499 if (!g_ascii_strcasecmp(state, "BSY"))
493 status = "busy"; 500 status = "busy";
494 else if (!g_ascii_strcasecmp(state, "IDL")) 501 else if (!g_ascii_strcasecmp(state, "IDL"))
495 { 502 {
496 /* do something about idle time? */ 503 /* XXX - Do something about idle time? */
497 status = "idle"; 504 status = "idle";
498 } 505 }
499 else if (!g_ascii_strcasecmp(state, "BRB")) 506 else if (!g_ascii_strcasecmp(state, "BRB"))
500 status = "brb"; 507 status = "brb";
501 else if (!g_ascii_strcasecmp(state, "AWY")) 508 else if (!g_ascii_strcasecmp(state, "AWY"))
505 else if (!g_ascii_strcasecmp(state, "LUN")) 512 else if (!g_ascii_strcasecmp(state, "LUN"))
506 status = "lunch"; 513 status = "lunch";
507 else 514 else
508 status = "available"; 515 status = "available";
509 516
510 /* serv_got_update(gc, passport, TRUE, 0, 0, idle, status); */ 517 gaim_prpl_got_user_status(account, passport, status, NULL);
511 gaim_prpl_got_user_status(gc->account, passport, status, NULL);
512 } 518 }
513 519
514 static void 520 static void
515 ipg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len) 521 ipg_cmd_post(MsnCmdProc *cmdproc, MsnCommand *cmd, char *payload, size_t len)
516 { 522 {
528 534
529 static void 535 static void
530 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) 536 nln_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
531 { 537 {
532 MsnSession *session; 538 MsnSession *session;
539 GaimAccount *account;
533 GaimConnection *gc; 540 GaimConnection *gc;
534 MsnUser *user; 541 MsnUser *user;
535 MsnObject *msnobj; 542 MsnObject *msnobj;
536 const char *state; 543 const char *state;
537 const char *passport; 544 const char *passport;
538 const char *friendly; 545 const char *friendly;
539 const char *status; 546 const char *status;
540 547
541 session = cmdproc->session; 548 session = cmdproc->session;
542 gc = session->account->gc; 549 account = session->account;
550 gc = gaim_account_get_connection(account);
543 551
544 state = cmd->params[0]; 552 state = cmd->params[0];
545 passport = cmd->params[1]; 553 passport = cmd->params[1];
546 friendly = gaim_url_decode(cmd->params[2]); 554 friendly = gaim_url_decode(cmd->params[2]);
547 555
568 576
569 if (!g_ascii_strcasecmp(state, "BSY")) 577 if (!g_ascii_strcasecmp(state, "BSY"))
570 status = "busy"; 578 status = "busy";
571 else if (!g_ascii_strcasecmp(state, "IDL")) 579 else if (!g_ascii_strcasecmp(state, "IDL"))
572 { 580 {
573 /* do something about idle time? */ 581 /* XXX - Do something about idle time? */
574 status = "idle"; 582 status = "idle";
575 } 583 }
576 else if (!g_ascii_strcasecmp(state, "BRB")) 584 else if (!g_ascii_strcasecmp(state, "BRB"))
577 status = "brb"; 585 status = "brb";
578 else if (!g_ascii_strcasecmp(state, "AWY")) 586 else if (!g_ascii_strcasecmp(state, "AWY"))
582 else if (!g_ascii_strcasecmp(state, "LUN")) 590 else if (!g_ascii_strcasecmp(state, "LUN"))
583 status = "lunch"; 591 status = "lunch";
584 else 592 else
585 status = "available"; 593 status = "available";
586 594
587 /* serv_got_update(gc, passport, TRUE, 0, 0, idle, status); */ 595 gaim_prpl_got_user_status(account, passport, status, NULL);
588 gaim_prpl_got_user_status(gc->account, passport, status, NULL);
589 } 596 }
590 597
591 static void 598 static void
592 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd) 599 chg_cmd(MsnCmdProc *cmdproc, MsnCommand *cmd)
593 { 600 {

mercurial