# HG changeset patch # User Marcus Lundblad # Date 1233691982 0 # Node ID 65f2c84f122f1ebb0f9fa6cbd250e17ed1148afe # Parent c5d2559d6e0d3b8a1a40f07f62846f65e1733b8b Only show idle time for idle resources in tooltip text when there is more than one resource online for a buddy. Since if there is only one resource online, and it is idle, this idle time will be shown as the "over all" idle time for the buddy. This avoid showing redundant information. diff -r c5d2559d6e0d -r 65f2c84f122f libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Sun Feb 01 19:43:13 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Tue Feb 03 20:13:02 2009 +0000 @@ -1686,7 +1686,7 @@ void jabber_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) { JabberBuddy *jb; - + g_return_if_fail(b != NULL); g_return_if_fail(b->account != NULL); g_return_if_fail(b->account->gc != NULL); @@ -1701,6 +1701,8 @@ const char *sub; GList *l; const char *mood; + gboolean multiple_resources = + jb->resources && g_list_next(jb->resources); if (full) { PurpleStatus *status; @@ -1747,8 +1749,8 @@ g_free(playing); } } - } - + } + for(l=jb->resources; l; l = l->next) { char *text = NULL; char *res = NULL; @@ -1788,7 +1790,10 @@ g_free(text); /* if the resource is idle, show that */ - if (jbr->idle) { + /* only show it if there is more than one resource available for + the buddy, since the "general" idleness will be shown anyway, + this way we can see see the idleness of lower-priority resources */ + if (jbr->idle && multiple_resources) { gchar *idle_str = purple_str_seconds_to_string(time(NULL) - jbr->idle); label = g_strdup_printf("%s%s",