comparison src/protocols/msn/msn.c @ 7590:3a48ade4f510

[gaim-migrate @ 8208] The MSNSLP stuff pretty much works. I have it disabled in this commit just in case, but I should have the rest done tonight. Also, client IDs are now sent (which was part of the problem), as are the MSNObjects (the other half of the problem). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 22 Nov 2003 00:47:24 +0000
parents cb9c3b6d6de9
children 66d9440db6ec
comparison
equal deleted inserted replaced
7589:59c1cee97cbb 7590:3a48ade4f510
606 msn_set_away(GaimConnection *gc, const char *state, const char *msg) 606 msn_set_away(GaimConnection *gc, const char *state, const char *msg)
607 { 607 {
608 MsnSession *session = gc->proto_data; 608 MsnSession *session = gc->proto_data;
609 const char *away; 609 const char *away;
610 610
611 if (gc->away != NULL) { 611 if (gc->away != NULL)
612 {
612 g_free(gc->away); 613 g_free(gc->away);
613 gc->away = NULL; 614 gc->away = NULL;
614 } 615 }
615 616
616 if (msg != NULL) { 617 if (msg != NULL)
618 {
617 gc->away = g_strdup(""); 619 gc->away = g_strdup("");
618 away = "AWY"; 620 away = "AWY";
619 } 621 }
620 else if (state) { 622 else if (state)
623 {
621 gc->away = g_strdup(""); 624 gc->away = g_strdup("");
622 625
623 if (!strcmp(state, _("Away From Computer"))) 626 if (!strcmp(state, _("Away From Computer")))
624 away = "AWY"; 627 away = "AWY";
625 else if (!strcmp(state, _("Be Right Back"))) 628 else if (!strcmp(state, _("Be Right Back")))
630 away = "PHN"; 633 away = "PHN";
631 else if (!strcmp(state, _("Out To Lunch"))) 634 else if (!strcmp(state, _("Out To Lunch")))
632 away = "LUN"; 635 away = "LUN";
633 else if (!strcmp(state, _("Hidden"))) 636 else if (!strcmp(state, _("Hidden")))
634 away = "HDN"; 637 away = "HDN";
635 else { 638 else
639 {
636 g_free(gc->away); 640 g_free(gc->away);
637 gc->away = NULL; 641 gc->away = NULL;
638 away = "NLN"; 642 away = "NLN";
639 } 643 }
640 } 644 }
641 else if (gc->is_idle) 645 else if (gc->is_idle)
642 away = "IDL"; 646 away = "IDL";
643 else 647 else
644 away = "NLN"; 648 away = "NLN";
645 649
646 if (!msn_servconn_send_command(session->notification_conn, "CHG", away)) { 650 msn_session_change_status(session, away);
647 gaim_connection_error(gc, _("Write error"));
648 return;
649 }
650 } 651 }
651 652
652 static void 653 static void
653 msn_set_idle(GaimConnection *gc, int idle) 654 msn_set_idle(GaimConnection *gc, int idle)
654 { 655 {
655 MsnSession *session = gc->proto_data; 656 MsnSession *session = gc->proto_data;
656 657
657 if (gc->away != NULL) 658 if (gc->away != NULL)
658 return; 659 return;
659 660
660 if (!msn_servconn_send_command(session->notification_conn, "CHG", 661 msn_session_change_status(session, (idle ? "IDL" : "NLN"));
661 (idle ? "IDL" : "NLN"))) {
662
663 gaim_connection_error(gc, _("Write error"));
664 return;
665 }
666 } 662 }
667 663
668 static void 664 static void
669 msn_add_buddy(GaimConnection *gc, const char *name, GaimGroup *group) 665 msn_add_buddy(GaimConnection *gc, const char *name, GaimGroup *group)
670 { 666 {
1232 1228
1233 return buf; 1229 return buf;
1234 } 1230 }
1235 1231
1236 static void 1232 static void
1233 msn_set_buddy_icon(GaimConnection *gc, const char *filename)
1234 {
1235 MsnSession *session = (MsnSession *)gc->proto_data;
1236 MsnUser *user = session->user;
1237
1238 msn_user_set_buddy_icon(user, filename);
1239
1240 msn_session_change_status(session, session->away_state);
1241 }
1242
1243 static void
1237 msn_remove_group(GaimConnection *gc, const char *name) 1244 msn_remove_group(GaimConnection *gc, const char *name)
1238 { 1245 {
1239 MsnSession *session = (MsnSession *)gc->proto_data; 1246 MsnSession *session = (MsnSession *)gc->proto_data;
1240 MsnGroup *group; 1247 MsnGroup *group;
1241 1248
1603 msn_group_buddy, 1610 msn_group_buddy,
1604 msn_rename_group, 1611 msn_rename_group,
1605 msn_buddy_free, 1612 msn_buddy_free,
1606 msn_convo_closed, 1613 msn_convo_closed,
1607 msn_normalize, 1614 msn_normalize,
1608 NULL, 1615 msn_set_buddy_icon,
1609 msn_remove_group 1616 msn_remove_group
1610 }; 1617 };
1611 1618
1612 static GaimPluginInfo info = 1619 static GaimPluginInfo info =
1613 { 1620 {