[gaim-migrate @ 15392]

Wed, 25 Jan 2006 04:44:41 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Wed, 25 Jan 2006 04:44:41 +0000
changeset 13034
cfeb9826ba96
parent 13033
c98a5209f3b2
child 13035
8bda42365f62

[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.

src/gtkblist.c file | annotate | diff | comparison | revisions
--- a/src/gtkblist.c	Wed Jan 25 02:58:54 2006 +0000
+++ b/src/gtkblist.c	Wed Jan 25 04:44:41 2006 +0000
@@ -2929,9 +2929,9 @@
 
 	presence = gaim_buddy_get_presence(b);
 
-	if (!gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons")) {
-
-		if ((gaim_presence_is_idle(presence) || !GAIM_BUDDY_IS_ONLINE(b)) && !selected)
+	if (!gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"))
+	{
+		if (!selected && (gaim_presence_is_idle(presence) || !gaim_presence_is_online(presence)))
 		{
 			text = g_strdup_printf("<span color='%s'>%s</span>",
 					       dim_grey(), esc);
@@ -3011,32 +3011,35 @@
 			idletime = g_strdup(_("Idle"));
 	}
 
-	if(!GAIM_BUDDY_IS_ONLINE(b) && !statustext)
-		statustext = g_strdup(_("Offline "));
-
-	if (gaim_presence_is_idle(presence) && !selected) {
-		text =  g_strdup_printf("<span color='%s'>%s</span>\n"
-					"<span color='%s' size='smaller'>%s%s%s</span>",
-					dim_grey(), esc, dim_grey(),
-					idletime != NULL ? idletime : "",
-					(idletime != NULL && statustext != NULL) ? " - " : "",
-					statustext != NULL ? statustext : "");
-	} else if (statustext == NULL && idletime == NULL && GAIM_BUDDY_IS_ONLINE(b)) {
-		text = g_strdup(esc);
-	} else {
-		if (selected)
+	if(!gaim_presence_is_online(presence) && !statustext)
+		statustext = g_strdup(_("Offline"));
+
+	if (statustext == NULL && idletime == NULL)
+	{
+		if (!selected && gaim_presence_is_idle(presence))
+			text = g_strdup_printf("<span color='%s'>%s</span>", dim_grey(), esc);
+		else
+			text = g_strdup(esc);
+	}
+	else
+	{
+		if (!selected && (gaim_presence_is_idle(presence) || !gaim_presence_is_online(presence)))
+		{
+			text = g_strdup_printf("<span color='%s'>%s</span>\n"
+						"<span color='%s' size='smaller'>%s%s%s</span>",
+						dim_grey(), esc, dim_grey(),
+						idletime != NULL ? idletime : "",
+						(idletime != NULL && statustext != NULL) ? " - " : "",
+						statustext != NULL ? statustext : "");
+		}
+		else
+		{
 			text = g_strdup_printf("%s\n"
 					       "<span size='smaller'>%s%s%s</span>", esc,
 					       idletime != NULL ? idletime : "",
 					       (idletime != NULL && statustext != NULL) ? " - " : "",
 					       statustext != NULL ? statustext :  "");
-		else
-			text = g_strdup_printf("%s\n"
-					       "<span color='%s' size='smaller'>%s%s%s</span>", esc,
-					       dim_grey(),
-					       idletime != NULL ? idletime : "",
-					       (idletime != NULL && statustext != NULL) ? " - " : "",
-					       statustext != NULL ? statustext :  "");
+		}
 	}
 
 	g_free(idletime);

mercurial