--- a/libpurple/protocols/jabber/jabber.c Mon Dec 22 07:51:06 2008 +0000 +++ b/libpurple/protocols/jabber/jabber.c Mon Dec 22 11:24:17 2008 +0000 @@ -1451,8 +1451,14 @@ void jabber_idle_set(PurpleConnection *gc, int idle) { JabberStream *js = gc->proto_data; - + PurpleAccount *account = purple_connection_get_account(gc); + PurpleStatus *status = purple_account_get_active_status(account); + js->idle = idle ? time(NULL) - idle : idle; + + /* send out an updated prescence */ + purple_debug_info("jabber", "sending updated presence for idle\n"); + jabber_presence_send(account, status); } static void jabber_blocklist_parse(JabberStream *js, xmlnode *packet, gpointer data) @@ -1744,10 +1750,21 @@ (text ? text : "")); purple_notify_user_info_add_pair(user_info, label, value); - g_free(label); g_free(value); g_free(text); + + /* if the resource is idle, show that */ + if (jbr->idle) { + gchar *idle_str = + purple_str_seconds_to_string(time(NULL) - jbr->idle); + label = g_strdup_printf("%s%s", + _("Idle"), (res ? res : "")); + purple_notify_user_info_add_pair(user_info, label, idle_str); + g_free(idle_str); + g_free(label); + } + g_free(res); }