about summary refs log tree commit diff stats
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/console.c39
-rw-r--r--src/ui/core.c30
-rw-r--r--src/ui/ui.h3
3 files changed, 31 insertions, 41 deletions
diff --git a/src/ui/console.c b/src/ui/console.c
index 80bfe9f5..666f7015 100644
--- a/src/ui/console.c
+++ b/src/ui/console.c
@@ -1354,27 +1354,48 @@ cons_autoaway_setting(void)
 {
     char *pref_autoaway_mode = prefs_get_string(PREF_AUTOAWAY_MODE);
     if (strcmp(pref_autoaway_mode, "off") == 0) {
-        cons_show("Autoaway (/autoaway mode)            : OFF");
+        cons_show("Autoaway (/autoaway mode)                 : OFF");
     } else {
-        cons_show("Autoaway (/autoaway mode)            : %s", pref_autoaway_mode);
+        cons_show("Autoaway (/autoaway mode)                 : %s", pref_autoaway_mode);
     }
     prefs_free_string(pref_autoaway_mode);
 
-    cons_show("Autoaway minutes (/autoaway time)    : %d minutes", prefs_get_autoaway_time());
+    int away_time = prefs_get_autoaway_time();
+    if (away_time == 1) {
+        cons_show("Autoaway away minutes (/autoaway time)    : 1 minute");
+    } else {
+        cons_show("Autoaway away minutes (/autoaway time)    : %d minutes", away_time);
+    }
+
+    int xa_time = prefs_get_autoxa_time();
+    if (xa_time == 0) {
+        cons_show("Autoaway xa minutes (/autoaway time)      : OFF");
+    } else if (xa_time == 1) {
+        cons_show("Autoaway xa minutes (/autoaway time)      : 1 minute");
+    } else {
+        cons_show("Autoaway xa minutes (/autoaway time)      : %d minutes", xa_time);
+    }
 
     char *pref_autoaway_message = prefs_get_string(PREF_AUTOAWAY_MESSAGE);
-    if ((pref_autoaway_message == NULL) ||
-            (strcmp(pref_autoaway_message, "") == 0)) {
-        cons_show("Autoaway message (/autoaway message) : OFF");
+    if ((pref_autoaway_message == NULL) || (strcmp(pref_autoaway_message, "") == 0)) {
+        cons_show("Autoaway away message (/autoaway message) : OFF");
     } else {
-        cons_show("Autoaway message (/autoaway message) : \"%s\"", pref_autoaway_message);
+        cons_show("Autoaway away message (/autoaway message) : \"%s\"", pref_autoaway_message);
     }
     prefs_free_string(pref_autoaway_message);
 
+    char *pref_autoxa_message = prefs_get_string(PREF_AUTOXA_MESSAGE);
+    if ((pref_autoxa_message == NULL) || (strcmp(pref_autoxa_message, "") == 0)) {
+        cons_show("Autoaway xa message (/autoaway message)   : OFF");
+    } else {
+        cons_show("Autoaway xa message (/autoaway message)   : \"%s\"", pref_autoxa_message);
+    }
+    prefs_free_string(pref_autoxa_message);
+
     if (prefs_get_boolean(PREF_AUTOAWAY_CHECK)) {
-        cons_show("Autoaway check (/autoaway check)     : ON");
+        cons_show("Autoaway check (/autoaway check)          : ON");
     } else {
-        cons_show("Autoaway check (/autoaway check)     : OFF");
+        cons_show("Autoaway check (/autoaway check)          : OFF");
     }
 }
 
diff --git a/src/ui/core.c b/src/ui/core.c
index 3950ecea..ff6d90ce 100644
--- a/src/ui/core.c
+++ b/src/ui/core.c
@@ -552,36 +552,6 @@ ui_group_removed(const char * const contact, const char * const group)
 }
 
 void
-ui_auto_away(void)
-{
-    char *pref_autoaway_message = prefs_get_string(PREF_AUTOAWAY_MESSAGE);
-    if (pref_autoaway_message) {
-        int pri =
-            accounts_get_priority_for_presence_type(jabber_get_account_name(),
-                RESOURCE_AWAY);
-        cons_show("Idle for %d minutes, status set to away (priority %d), \"%s\".",
-            prefs_get_autoaway_time(), pri, pref_autoaway_message);
-        title_bar_set_presence(CONTACT_AWAY);
-    } else {
-        int pri =
-            accounts_get_priority_for_presence_type(jabber_get_account_name(),
-                RESOURCE_AWAY);
-        cons_show("Idle for %d minutes, status set to away (priority %d).",
-            prefs_get_autoaway_time(), pri);
-        title_bar_set_presence(CONTACT_AWAY);
-    }
-    prefs_free_string(pref_autoaway_message);
-}
-
-void
-ui_end_auto_away(resource_presence_t presence)
-{
-    int pri = accounts_get_priority_for_presence_type(jabber_get_account_name(), presence);
-    cons_show("No longer idle, status set to online (priority %d).", pri);
-    title_bar_set_presence(contact_presence_from_resource_presence(presence));
-}
-
-void
 ui_titlebar_presence(contact_presence_t presence)
 {
     title_bar_set_presence(presence);
diff --git a/src/ui/ui.h b/src/ui/ui.h
index fd3caf70..3aae7643 100644
--- a/src/ui/ui.h
+++ b/src/ui/ui.h
@@ -225,8 +225,7 @@ void ui_subwin_page_up(void);
 void ui_subwin_page_down(void);
 void ui_clear_win(ProfWin *window);
 
-void ui_auto_away(void);
-void ui_end_auto_away(resource_presence_t presence);
+void ui_auto_away(char *message, gint time, resource_presence_t res_presence);
 void ui_titlebar_presence(contact_presence_t presence);
 void ui_handle_login_account_success(ProfAccount *account);
 void ui_update_presence(const resource_presence_t resource_presence,