src/protocols/oscar/oscar.c

changeset 4744
c3a5a15c01f7
parent 4743
21bf5b69519d
child 4754
216cd548ad68
equal deleted inserted replaced
4743:21bf5b69519d 4744:c3a5a15c01f7
2783 static char buf[512], *tmp; 2783 static char buf[512], *tmp;
2784 int count = 0, i = 0; 2784 int count = 0, i = 0;
2785 guint bit = 1; 2785 guint bit = 1;
2786 2786
2787 if (!caps) { 2787 if (!caps) {
2788 strncpy(buf, _("<i>none advertised</i>"), sizeof(buf)); 2788 return NULL;
2789 } else while (bit <= 0x20000) { 2789 } else while (bit <= 0x20000) {
2790 if (bit & caps) { 2790 if (bit & caps) {
2791 switch (bit) { 2791 switch (bit) {
2792 case 0x1: 2792 case 0x1:
2793 tmp = _("Buddy Icon"); 2793 tmp = _("Buddy Icon");
2850 tmp); 2850 tmp);
2851 count++; 2851 count++;
2852 } 2852 }
2853 bit <<= 1; 2853 bit <<= 1;
2854 } 2854 }
2855 return buf; 2855 return buf;
2856 } 2856 }
2857 2857
2858 static char *oscar_tooltip_text(struct buddy *b) { 2858 static char *oscar_tooltip_text(struct buddy *b) {
2859 struct gaim_connection *gc = b->account->gc; 2859 struct gaim_connection *gc = b->account->gc;
2860 struct oscar_data *od = gc->proto_data; 2860 struct oscar_data *od = gc->proto_data;
2861 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name)); 2861 struct buddyinfo *bi = g_hash_table_lookup(od->buddyinfo, normalize(b->name));
2862 2862
2863 if (bi) 2863 if (bi) {
2864 return g_strdup_printf(_("<b>Online Since:</b> %s<b>Capabilities:</b> %s"), asctime(localtime(&bi->signon)), caps_string(bi->caps)); 2864 char *caps = caps_string(bi->caps);
2865 else 2865 char *time = asctime(localtime(&bi->signon));
2866 *(strchr(time, '\n')) = '\0';
2867 return g_strdup_printf(_("<b>Online Since:</b> %s%s%s"),
2868 time,
2869 caps ? _("\n<b>Capabilities:</b> ") : "", caps ? caps : "");
2870 } else {
2866 return NULL; 2871 return NULL;
2872 }
2867 } 2873 }
2868 2874
2869 static int gaim_parse_user_info(aim_session_t *sess, aim_frame_t *fr, ...) { 2875 static int gaim_parse_user_info(aim_session_t *sess, aim_frame_t *fr, ...) {
2870 aim_userinfo_t *info; 2876 aim_userinfo_t *info;
2871 char *text_enc = NULL, *text = NULL, *utf8 = NULL; 2877 char *text_enc = NULL, *text = NULL, *utf8 = NULL;

mercurial