| 686 serv_got_update(gc, usr, 0, 0, 0, 0, 0, 0); |
686 serv_got_update(gc, usr, 0, 0, 0, 0, 0, 0); |
| 687 } else if (!g_strncasecmp(buf, "GTC", 3)) { |
687 } else if (!g_strncasecmp(buf, "GTC", 3)) { |
| 688 } else if (!g_strncasecmp(buf, "INF", 3)) { |
688 } else if (!g_strncasecmp(buf, "INF", 3)) { |
| 689 } else if (!g_strncasecmp(buf, "ILN", 3)) { |
689 } else if (!g_strncasecmp(buf, "ILN", 3)) { |
| 690 char *state, *user, *tmp = buf; |
690 char *state, *user, *tmp = buf; |
| 691 int status = UC_NORMAL; |
691 int status = 0; |
| 692 |
692 |
| 693 GET_NEXT(tmp); |
693 GET_NEXT(tmp); |
| 694 |
694 |
| 695 GET_NEXT(tmp); |
695 GET_NEXT(tmp); |
| 696 state = tmp; |
696 state = tmp; |
| 699 user = tmp; |
699 user = tmp; |
| 700 |
700 |
| 701 GET_NEXT(tmp); |
701 GET_NEXT(tmp); |
| 702 |
702 |
| 703 if (!g_strcasecmp(state, "BSY")) { |
703 if (!g_strcasecmp(state, "BSY")) { |
| 704 status |= (MSN_BUSY << 5); |
704 status |= UC_UNAVAILABLE | (MSN_BUSY << 1); |
| 705 } else if (!g_strcasecmp(state, "IDL")) { |
705 } else if (!g_strcasecmp(state, "IDL")) { |
| 706 status |= (MSN_IDLE << 5); |
706 status |= UC_UNAVAILABLE | (MSN_IDLE << 1); |
| 707 } else if (!g_strcasecmp(state, "BRB")) { |
707 } else if (!g_strcasecmp(state, "BRB")) { |
| 708 status |= (MSN_BRB << 5); |
708 status |= UC_UNAVAILABLE | (MSN_BRB << 1); |
| 709 } else if (!g_strcasecmp(state, "AWY")) { |
709 } else if (!g_strcasecmp(state, "AWY")) { |
| 710 status = UC_UNAVAILABLE; |
710 status |= UC_UNAVAILABLE | (MSN_AWAY << 1); |
| 711 } else if (!g_strcasecmp(state, "PHN")) { |
711 } else if (!g_strcasecmp(state, "PHN")) { |
| 712 status |= (MSN_PHONE << 5); |
712 status |= UC_UNAVAILABLE | (MSN_PHONE << 1); |
| 713 } else if (!g_strcasecmp(state, "LUN")) { |
713 } else if (!g_strcasecmp(state, "LUN")) { |
| 714 status |= (MSN_LUNCH << 5); |
714 status |= UC_UNAVAILABLE | (MSN_LUNCH << 1); |
| 715 } |
715 } |
| 716 |
716 |
| 717 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); |
717 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); |
| 718 } else if (!g_strncasecmp(buf, "LST", 3)) { |
718 } else if (!g_strncasecmp(buf, "LST", 3)) { |
| 719 char *which, *who, *friend, *tmp = buf; |
719 char *which, *who, *friend, *tmp = buf; |
| 802 |
802 |
| 803 g_free(final); |
803 g_free(final); |
| 804 g_free(msg); |
804 g_free(msg); |
| 805 } else if (!g_strncasecmp(buf, "NLN", 3)) { |
805 } else if (!g_strncasecmp(buf, "NLN", 3)) { |
| 806 char *state, *user, *tmp = buf; |
806 char *state, *user, *tmp = buf; |
| 807 int status = UC_NORMAL; |
807 int status = 0; |
| 808 |
808 |
| 809 GET_NEXT(tmp); |
809 GET_NEXT(tmp); |
| 810 state = tmp; |
810 state = tmp; |
| 811 |
811 |
| 812 GET_NEXT(tmp); |
812 GET_NEXT(tmp); |
| 813 user = tmp; |
813 user = tmp; |
| 814 |
814 |
| 815 GET_NEXT(tmp); |
815 GET_NEXT(tmp); |
| 816 |
816 |
| 817 if (!g_strcasecmp(state, "BSY")) { |
817 if (!g_strcasecmp(state, "BSY")) { |
| 818 status |= (MSN_BUSY << 5); |
818 status |= UC_UNAVAILABLE | (MSN_BUSY << 1); |
| 819 } else if (!g_strcasecmp(state, "IDL")) { |
819 } else if (!g_strcasecmp(state, "IDL")) { |
| 820 status |= (MSN_IDLE << 5); |
820 status |= UC_UNAVAILABLE | (MSN_IDLE << 1); |
| 821 } else if (!g_strcasecmp(state, "BRB")) { |
821 } else if (!g_strcasecmp(state, "BRB")) { |
| 822 status |= (MSN_BRB << 5); |
822 status |= UC_UNAVAILABLE | (MSN_BRB << 1); |
| 823 } else if (!g_strcasecmp(state, "AWY")) { |
823 } else if (!g_strcasecmp(state, "AWY")) { |
| 824 status = UC_UNAVAILABLE; |
824 status |= UC_UNAVAILABLE | (MSN_AWAY << 1); |
| 825 } else if (!g_strcasecmp(state, "PHN")) { |
825 } else if (!g_strcasecmp(state, "PHN")) { |
| 826 status |= (MSN_PHONE << 5); |
826 status |= UC_UNAVAILABLE | (MSN_PHONE << 1); |
| 827 } else if (!g_strcasecmp(state, "LUN")) { |
827 } else if (!g_strcasecmp(state, "LUN")) { |
| 828 status |= (MSN_LUNCH << 5); |
828 status |= UC_UNAVAILABLE | (MSN_LUNCH << 1); |
| 829 } |
829 } |
| 830 |
830 |
| 831 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); |
831 serv_got_update(gc, user, 1, 0, 0, 0, status, 0); |
| 832 } else if (!g_strncasecmp(buf, "OUT", 3)) { |
832 } else if (!g_strncasecmp(buf, "OUT", 3)) { |
| 833 } else if (!g_strncasecmp(buf, "PRP", 3)) { |
833 } else if (!g_strncasecmp(buf, "PRP", 3)) { |
| 1259 g_snprintf(buf, sizeof(buf), "OUT\n"); |
1259 g_snprintf(buf, sizeof(buf), "OUT\n"); |
| 1260 if (msn_write(ms->fd, buf, strlen(buf)) < 0) |
1260 if (msn_write(ms->fd, buf, strlen(buf)) < 0) |
| 1261 msn_kill_switch(ms); |
1261 msn_kill_switch(ms); |
| 1262 } |
1262 } |
| 1263 |
1263 |
| 1264 static GList *msn_away_states() |
1264 static GList *msn_away_states(struct gaim_connection *gc) |
| 1265 { |
1265 { |
| 1266 GList *m = NULL; |
1266 GList *m = NULL; |
| 1267 |
1267 |
| 1268 m = g_list_append(m, "Available"); |
1268 m = g_list_append(m, "Available"); |
| 1269 m = g_list_append(m, "Away From Computer"); |
1269 m = g_list_append(m, "Away From Computer"); |
| 1370 GList *m = NULL; |
1370 GList *m = NULL; |
| 1371 struct proto_buddy_menu *pbm; |
1371 struct proto_buddy_menu *pbm; |
| 1372 struct buddy *b = find_buddy(gc, who); |
1372 struct buddy *b = find_buddy(gc, who); |
| 1373 static char buf[MSN_BUF_LEN]; |
1373 static char buf[MSN_BUF_LEN]; |
| 1374 |
1374 |
| 1375 if (!b || !(b->uc >> 5)) |
1375 if (!b || !(b->uc >> 1)) |
| 1376 return m; |
1376 return m; |
| 1377 |
1377 |
| 1378 pbm = g_new0(struct proto_buddy_menu, 1); |
1378 pbm = g_new0(struct proto_buddy_menu, 1); |
| 1379 g_snprintf(buf, sizeof(buf), "Status: %s", msn_get_away_text(b->uc >> 5)); |
1379 g_snprintf(buf, sizeof(buf), "Status: %s", msn_get_away_text(b->uc >> 1)); |
| 1380 pbm->label = buf; |
1380 pbm->label = buf; |
| 1381 pbm->callback = NULL; |
1381 pbm->callback = NULL; |
| 1382 pbm->gc = gc; |
1382 pbm->gc = gc; |
| 1383 m = g_list_append(m, pbm); |
1383 m = g_list_append(m, pbm); |
| 1384 |
1384 |