From 65c9c3a7fcee2798bfd701dbcd4714f26ce3306c Mon Sep 17 00:00:00 2001 From: James Booth Date: Sun, 14 Dec 2014 19:57:29 +0000 Subject: [PATCH] Allow params to /bookmark when in a room --- src/command/commands.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/command/commands.c b/src/command/commands.c index 34d0cf54..f1d6ac21 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -2689,28 +2689,21 @@ cmd_bookmark(gchar **args, struct cmd_help_t help) win_type_t win_type = ui_current_win_type(); - if (win_type == WIN_MUC) { - gchar *cmd = args[0]; - + gchar *cmd = args[0]; + if (win_type == WIN_MUC && cmd == NULL) { // default to current nickname, password, and autojoin "on" - if (cmd == NULL) { - char *jid = ui_current_recipient(); - char *nick = muc_nick(jid); - char *password = muc_password(jid); - gboolean added = bookmark_add(jid, nick, password, "on"); - if (added) { - ui_current_print_formatted_line('!', 0, "Bookmark added for %s.", jid); - } else { - ui_current_print_formatted_line('!', 0, "Bookmark already exists for %s.", jid); - } - return TRUE; + char *jid = ui_current_recipient(); + char *nick = muc_nick(jid); + char *password = muc_password(jid); + gboolean added = bookmark_add(jid, nick, password, "on"); + if (added) { + ui_current_print_formatted_line('!', 0, "Bookmark added for %s.", jid); } else { - ui_current_print_formatted_line('!', 0, "No arguments required for /bookmark in a chat room"); - return TRUE; + ui_current_print_formatted_line('!', 0, "Bookmark already exists for %s.", jid); } + return TRUE; } else { - gchar *cmd = args[0]; if (cmd == NULL) { cons_show("Usage: %s", help.usage); return TRUE;