comparison src/gtkblist.c @ 13034:615c84e94745

[gaim-migrate @ 15392] Fix SF Bug #1414257 'If you disable idle times, when someone goes idle (but not away), their name in the buddy list is still 'higher' than it should be...as though the idle time is still being displayed below it, even though it's not. (This is only visible when "Show Buddy Details" is on).' Also, I cleaned up a little code in that function. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Wed, 25 Jan 2006 04:44:41 +0000
parents d09b19783b8d
children 4005ad2b3ca9
comparison
equal deleted inserted replaced
13033:69b3d5cbd2b1 13034:615c84e94745
2927 if (prpl != NULL) 2927 if (prpl != NULL)
2928 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl); 2928 prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(prpl);
2929 2929
2930 presence = gaim_buddy_get_presence(b); 2930 presence = gaim_buddy_get_presence(b);
2931 2931
2932 if (!gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) { 2932 if (!gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"))
2933 2933 {
2934 if ((gaim_presence_is_idle(presence) || !GAIM_BUDDY_IS_ONLINE(b)) && !selected) 2934 if (!selected && (gaim_presence_is_idle(presence) || !gaim_presence_is_online(presence)))
2935 { 2935 {
2936 text = g_strdup_printf("<span color='%s'>%s</span>", 2936 text = g_strdup_printf("<span color='%s'>%s</span>",
2937 dim_grey(), esc); 2937 dim_grey(), esc);
2938 g_free(esc); 2938 g_free(esc);
2939 return text; 2939 return text;
3009 } 3009 }
3010 else 3010 else
3011 idletime = g_strdup(_("Idle")); 3011 idletime = g_strdup(_("Idle"));
3012 } 3012 }
3013 3013
3014 if(!GAIM_BUDDY_IS_ONLINE(b) && !statustext) 3014 if(!gaim_presence_is_online(presence) && !statustext)
3015 statustext = g_strdup(_("Offline ")); 3015 statustext = g_strdup(_("Offline"));
3016 3016
3017 if (gaim_presence_is_idle(presence) && !selected) { 3017 if (statustext == NULL && idletime == NULL)
3018 text = g_strdup_printf("<span color='%s'>%s</span>\n" 3018 {
3019 "<span color='%s' size='smaller'>%s%s%s</span>", 3019 if (!selected && gaim_presence_is_idle(presence))
3020 dim_grey(), esc, dim_grey(), 3020 text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
3021 idletime != NULL ? idletime : "", 3021 else
3022 (idletime != NULL && statustext != NULL) ? " - " : "", 3022 text = g_strdup(esc);
3023 statustext != NULL ? statustext : ""); 3023 }
3024 } else if (statustext == NULL && idletime == NULL && GAIM_BUDDY_IS_ONLINE(b)) { 3024 else
3025 text = g_strdup(esc); 3025 {
3026 } else { 3026 if (!selected && (gaim_presence_is_idle(presence) || !gaim_presence_is_online(presence)))
3027 if (selected) 3027 {
3028 text = g_strdup_printf("<span color='%s'>%s</span>\n"
3029 "<span color='%s' size='smaller'>%s%s%s</span>",
3030 dim_grey(), esc, dim_grey(),
3031 idletime != NULL ? idletime : "",
3032 (idletime != NULL && statustext != NULL) ? " - " : "",
3033 statustext != NULL ? statustext : "");
3034 }
3035 else
3036 {
3028 text = g_strdup_printf("%s\n" 3037 text = g_strdup_printf("%s\n"
3029 "<span size='smaller'>%s%s%s</span>", esc, 3038 "<span size='smaller'>%s%s%s</span>", esc,
3030 idletime != NULL ? idletime : "", 3039 idletime != NULL ? idletime : "",
3031 (idletime != NULL && statustext != NULL) ? " - " : "", 3040 (idletime != NULL && statustext != NULL) ? " - " : "",
3032 statustext != NULL ? statustext : ""); 3041 statustext != NULL ? statustext : "");
3033 else 3042 }
3034 text = g_strdup_printf("%s\n"
3035 "<span color='%s' size='smaller'>%s%s%s</span>", esc,
3036 dim_grey(),
3037 idletime != NULL ? idletime : "",
3038 (idletime != NULL && statustext != NULL) ? " - " : "",
3039 statustext != NULL ? statustext : "");
3040 } 3043 }
3041 3044
3042 g_free(idletime); 3045 g_free(idletime);
3043 g_free(statustext); 3046 g_free(statustext);
3044 g_free(esc); 3047 g_free(esc);