From 3fa9ecb9d1f9fc24815d1fd6bd24f3a23886e885 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 5 Feb 2013 23:29:05 +0000 Subject: [PATCH] Show priority on autoaway messages --- src/profanity.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/profanity.c b/src/profanity.c index 9967b089..912ce3f1 100644 --- a/src/profanity.c +++ b/src/profanity.c @@ -441,13 +441,19 @@ _handle_idle_time() if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "away") == 0) { presence_update(PRESENCE_AWAY, prefs_get_string(PREF_AUTOAWAY_MESSAGE), 0); if (prefs_get_string(PREF_AUTOAWAY_MESSAGE) != NULL) { - cons_show("Idle for %d minutes, status set to away, \"%s\".", - prefs_get_autoaway_time(), prefs_get_string(PREF_AUTOAWAY_MESSAGE)); + int pri = + accounts_get_priority_for_presence_type(jabber_get_account_name(), + PRESENCE_AWAY); + cons_show("Idle for %d minutes, status set to away (priority %d), \"%s\".", + prefs_get_autoaway_time(), pri, prefs_get_string(PREF_AUTOAWAY_MESSAGE)); title_bar_set_status(PRESENCE_AWAY); win_current_page_off(); } else { - cons_show("Idle for %d minutes, status set to away.", - prefs_get_autoaway_time()); + int pri = + accounts_get_priority_for_presence_type(jabber_get_account_name(), + PRESENCE_AWAY); + cons_show("Idle for %d minutes, status set to away (priority %d).", + prefs_get_autoaway_time(), pri); title_bar_set_status(PRESENCE_AWAY); win_current_page_off(); } @@ -467,7 +473,10 @@ _handle_idle_time() if (prefs_get_boolean(PREF_AUTOAWAY_CHECK)) { if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "away") == 0) { presence_update(PRESENCE_ONLINE, NULL, 0); - cons_show("No longer idle, status set to online."); + int pri = + accounts_get_priority_for_presence_type(jabber_get_account_name(), + PRESENCE_ONLINE); + cons_show("No longer idle, status set to online (priority %d).", pri); title_bar_set_status(PRESENCE_ONLINE); win_current_page_off(); } else if (strcmp(prefs_get_string(PREF_AUTOAWAY_MODE), "idle") == 0) {