about summary refs log tree commit diff stats
path: root/src/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/command')
-rw-r--r--src/command/cmd_defs.c2
-rw-r--r--src/command/cmd_funcs.c18
2 files changed, 5 insertions, 15 deletions
diff --git a/src/command/cmd_defs.c b/src/command/cmd_defs.c
index 8f8ced09..d5eba7c8 100644
--- a/src/command/cmd_defs.c
+++ b/src/command/cmd_defs.c
@@ -576,7 +576,7 @@ static struct cmd_t command_defs[] =
         CMD_SYN(
             "/leave")
         CMD_DESC(
-            "Leave the current chat room.")
+            "Leave the current chat or room.")
         CMD_NOARGS
         CMD_NOEXAMPLES
     },
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index 3df17079..b1db10d6 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -4756,24 +4756,14 @@ cmd_clear(ProfWin *window, const char *const command, gchar **args)
 gboolean
 cmd_leave(ProfWin *window, const char *const command, gchar **args)
 {
-    jabber_conn_status_t conn_status = connection_get_status();
-    int index = wins_get_current_num();
-
-    if (window->type != WIN_MUC) {
-        cons_show("You can only use the /leave command in a chat room.");
+    if (window->type != WIN_MUC && window->type != WIN_CHAT && window->type != WIN_PRIVATE) {
+        cons_show("The /leave command is only valid in chat, or chat room windows.");
         cons_alert();
         return TRUE;
     }
 
-    // handle leaving rooms, or chat
-    if (conn_status == JABBER_CONNECTED) {
-        ui_close_connected_win(index);
-    }
-
-    // close the window
-    ui_close_win(index);
-
-    return TRUE;
+    // use /close behaviour
+    return cmd_close(window, "/leave", args);
 }
 
 gboolean