about summary refs log tree commit diff stats
path: root/src/command.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2013-01-31 22:48:21 +0000
committerJames Booth <boothj5@gmail.com>2013-01-31 22:48:21 +0000
commitb397a8c53e05f6b3fd2cc4a994e7176c354bb5b9 (patch)
tree1f1fe07b10cf284be6e5b958c72c617f9e3ae2d0 /src/command.c
parente6596735c4037c1f6dea69badd3fb26b67aebc0f (diff)
downloadprofani-tty-b397a8c53e05f6b3fd2cc4a994e7176c354bb5b9.tar.gz
The /priority command now sets per account/status settings
Diffstat (limited to 'src/command.c')
-rw-r--r--src/command.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/command.c b/src/command.c
index c717a3f2..200c89b1 100644
--- a/src/command.c
+++ b/src/command.c
@@ -558,10 +558,11 @@ static struct cmd_t setting_commands[] =
 
     { "/priority",
         _cmd_set_priority, parse_args, 1, 1,
-        { "/priority value", "Set priority for connection.",
+        { "/priority value", "Set priority for the current account.",
         { "/priority value",
           "---------------",
-          "Set priority for the current session.",
+          "Set priority for the current account, presence will be sent when calling this command.",
+          "See the /account command for more specific priority settings per presence status.",
           "value : Number between -128 and 127. Default value is 0.",
           NULL } } },
 
@@ -2189,11 +2190,19 @@ _cmd_set_autoaway(gchar **args, struct cmd_help_t help)
 static gboolean
 _cmd_set_priority(gchar **args, struct cmd_help_t help)
 {
+    jabber_conn_status_t conn_status = jabber_get_connection_status();
+
+    if (conn_status != JABBER_CONNECTED) {
+        cons_show("You are not currently connected.");
+        return TRUE;
+    }
+
     char *value = args[0];
     int intval;
 
     if (_strtoi(value, &intval, -128, 127) == 0) {
-        prefs_set_priority((int)intval);
+        accounts_set_priority_all(jabber_get_account_name(), intval);
+        //prefs_set_priority((int)intval);
         // update presence with new priority
         presence_update(jabber_get_presence_type(), jabber_get_presence_message(), 0);
         cons_show("Priority set to %d.", intval);