Mercurial > pidgin.yaz
comparison src/protocols/oscar/oscar.c @ 3101:8b0d58f74d3f
[gaim-migrate @ 3115]
Correctly show list icons from icq and wireless oscar users. Also correctly set icq user class for away. Thanks, Mark Doliner.
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Thu, 28 Mar 2002 19:10:34 +0000 |
parents | beb5d0e592d9 |
children | d3cb7d47fcb4 |
comparison
equal
deleted
inserted
replaced
3100:dd78d89c910b | 3101:8b0d58f74d3f |
---|---|
1610 return 1; | 1610 return 1; |
1611 } | 1611 } |
1612 | 1612 |
1613 static char *images(int flags) { | 1613 static char *images(int flags) { |
1614 static char buf[1024]; | 1614 static char buf[1024]; |
1615 g_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s", | 1615 g_snprintf(buf, sizeof(buf), "%s%s%s%s%s%s%s", |
1616 (flags & AIM_FLAG_ACTIVEBUDDY) ? "<IMG SRC=\"ab_icon.gif\">" : "", | 1616 (flags & AIM_FLAG_ACTIVEBUDDY) ? "<IMG SRC=\"ab_icon.gif\">" : "", |
1617 (flags & AIM_FLAG_UNCONFIRMED) ? "<IMG SRC=\"dt_icon.gif\">" : "", | 1617 (flags & AIM_FLAG_UNCONFIRMED) ? "<IMG SRC=\"dt_icon.gif\">" : "", |
1618 (flags & AIM_FLAG_AOL) ? "<IMG SRC=\"aol_icon.gif\">" : "", | 1618 (flags & AIM_FLAG_AOL) ? "<IMG SRC=\"aol_icon.gif\">" : "", |
1619 (flags & AIM_FLAG_ICQ) ? "<IMG SRC=\"icq_icon.gif\">" : "", | |
1619 (flags & AIM_FLAG_ADMINISTRATOR) ? "<IMG SRC=\"admin_icon.gif\">" : "", | 1620 (flags & AIM_FLAG_ADMINISTRATOR) ? "<IMG SRC=\"admin_icon.gif\">" : "", |
1620 (flags & AIM_FLAG_FREE) ? "<IMG SRC=\"free_icon.gif\">" : "", | 1621 (flags & AIM_FLAG_FREE) ? "<IMG SRC=\"free_icon.gif\">" : "", |
1621 (flags & AIM_FLAG_WIRELESS) ? "<IMG SRC=\"wireless_icon.gif\">" : ""); | 1622 (flags & AIM_FLAG_WIRELESS) ? "<IMG SRC=\"wireless_icon.gif\">" : ""); |
1622 return buf; | 1623 return buf; |
1623 } | 1624 } |
1625 | |
1624 | 1626 |
1625 /* XXX This is horribly copied from ../../buddy.c. */ | 1627 /* XXX This is horribly copied from ../../buddy.c. */ |
1626 static char *caps_string(guint caps) | 1628 static char *caps_string(guint caps) |
1627 { | 1629 { |
1628 static char buf[512], *tmp; | 1630 static char buf[512], *tmp; |
1712 infotype = (fu16_t)va_arg(ap, unsigned int); | 1714 infotype = (fu16_t)va_arg(ap, unsigned int); |
1713 prof_enc = va_arg(ap, char *); | 1715 prof_enc = va_arg(ap, char *); |
1714 prof = va_arg(ap, char *); | 1716 prof = va_arg(ap, char *); |
1715 va_end(ap); | 1717 va_end(ap); |
1716 | 1718 |
1717 g_snprintf(legend, sizeof legend, | 1719 if (!od->icq) { |
1718 _("<br><BODY BGCOLOR=WHITE><hr><I>Legend:</I><br><br>" | 1720 g_snprintf(legend, sizeof legend, |
1719 "<IMG SRC=\"free_icon.gif\"> : Normal AIM User<br>" | 1721 _("<br><BODY BGCOLOR=WHITE><hr><I>Legend:</I><br><br>" |
1720 "<IMG SRC=\"aol_icon.gif\"> : AOL User <br>" | 1722 "<IMG SRC=\"free_icon.gif\"> : Normal AIM User<br>" |
1721 "<IMG SRC=\"dt_icon.gif\"> : Trial AIM User <br>" | 1723 "<IMG SRC=\"aol_icon.gif\"> : AOL User <br>" |
1722 "<IMG SRC=\"admin_icon.gif\"> : Administrator <br>" | 1724 "<IMG SRC=\"dt_icon.gif\"> : Trial AIM User <br>" |
1723 "<IMG SRC=\"ab_icon.gif\"> : ActiveBuddy Interactive Agent<br>" | 1725 "<IMG SRC=\"admin_icon.gif\"> : Administrator <br>" |
1724 "<IMG SRC=\"wireless_icon.gif\"> : Wireless Device User<br>")); | 1726 "<IMG SRC=\"ab_icon.gif\"> : ActiveBuddy Interactive Agent<br>" |
1725 | 1727 "<IMG SRC=\"wireless_icon.gif\"> : Wireless Device User<br>")); |
1728 } | |
1729 | |
1726 if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE) { | 1730 if (info->present & AIM_USERINFO_PRESENT_ONLINESINCE) { |
1727 onlinesince = g_strdup_printf("Online Since : <B>%s</B><BR>\n", | 1731 onlinesince = g_strdup_printf("Online Since : <B>%s</B><BR>\n", |
1728 asctime(localtime(&info->onlinesince))); | 1732 asctime(localtime(&info->onlinesince))); |
1729 } | 1733 } |
1730 | 1734 |
2616 gc->away = ""; | 2620 gc->away = ""; |
2617 } else if (!strcmp(state, "Do Not Disturb")) { | 2621 } else if (!strcmp(state, "Do Not Disturb")) { |
2618 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_DND); | 2622 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_DND); |
2619 gc->away = ""; | 2623 gc->away = ""; |
2620 } else if (!strcmp(state, "Not Available")) { | 2624 } else if (!strcmp(state, "Not Available")) { |
2621 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT); | 2625 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY); |
2622 gc->away = ""; | 2626 gc->away = ""; |
2623 } else if (!strcmp(state, "Occupied")) { | 2627 } else if (!strcmp(state, "Occupied")) { |
2624 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_BUSY); | 2628 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_BUSY); |
2625 gc->away = ""; | 2629 gc->away = ""; |
2626 } else if (!strcmp(state, "Free For Chat")) { | 2630 } else if (!strcmp(state, "Free For Chat")) { |
2629 } else if (!strcmp(state, "Invisible")) { | 2633 } else if (!strcmp(state, "Invisible")) { |
2630 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); | 2634 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); |
2631 gc->away = ""; | 2635 gc->away = ""; |
2632 } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { | 2636 } else if (!strcmp(state, GAIM_AWAY_CUSTOM)) { |
2633 if (message) { | 2637 if (message) { |
2634 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT); | 2638 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY); |
2635 gc->away = ""; | 2639 gc->away = ""; |
2636 } else { | 2640 } else { |
2637 | 2641 |
2638 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); | 2642 aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); |
2639 } | 2643 } |
3092 static char **oscar_list_icon(int uc) { | 3096 static char **oscar_list_icon(int uc) { |
3093 if (uc == 0) | 3097 if (uc == 0) |
3094 return (char **)icon_online_xpm; | 3098 return (char **)icon_online_xpm; |
3095 if (uc & 0xff80) { | 3099 if (uc & 0xff80) { |
3096 uc >>= 7; | 3100 uc >>= 7; |
3101 if (uc & AIM_ICQ_STATE_INVISIBLE) | |
3102 return icon_offline_xpm; | |
3103 if (uc & AIM_ICQ_STATE_CHAT) | |
3104 return icon_ffc_xpm; | |
3105 if (uc & AIM_ICQ_STATE_BUSY) | |
3106 return icon_occ_xpm; | |
3107 if (uc & AIM_ICQ_STATE_OUT) | |
3108 return icon_na_xpm; | |
3109 if (uc & AIM_ICQ_STATE_DND) | |
3110 return icon_dnd_xpm; | |
3097 if (uc & AIM_ICQ_STATE_AWAY) | 3111 if (uc & AIM_ICQ_STATE_AWAY) |
3098 return icon_away_xpm; | 3112 return icon_away_xpm; |
3099 if (uc & AIM_ICQ_STATE_DND) | |
3100 return icon_dnd_xpm; | |
3101 if (uc & AIM_ICQ_STATE_OUT) | |
3102 return icon_na_xpm; | |
3103 if (uc & AIM_ICQ_STATE_BUSY) | |
3104 return icon_occ_xpm; | |
3105 if (uc & AIM_ICQ_STATE_CHAT) | |
3106 return icon_ffc_xpm; | |
3107 if (uc & AIM_ICQ_STATE_INVISIBLE) | |
3108 return icon_offline_xpm; | |
3109 return icon_online_xpm; | 3113 return icon_online_xpm; |
3110 } | 3114 } |
3115 if (uc & UC_UNAVAILABLE) | |
3116 return (char **)away_icon_xpm; | |
3111 if (uc & UC_WIRELESS) | 3117 if (uc & UC_WIRELESS) |
3112 return (char **)wireless_icon_xpm; | 3118 return (char **)wireless_icon_xpm; |
3113 if (uc & UC_UNAVAILABLE) | |
3114 return (char **)away_icon_xpm; | |
3115 if (uc & UC_AB) | 3119 if (uc & UC_AB) |
3116 return (char **)ab_xpm; | 3120 return (char **)ab_xpm; |
3117 if (uc & UC_AOL) | 3121 if (uc & UC_AOL) |
3118 return (char **)aol_icon_xpm; | 3122 return (char **)aol_icon_xpm; |
3119 if (uc & UC_ADMIN) | 3123 if (uc & UC_ADMIN) |