diff options
author | James Booth <boothj5@gmail.com> | 2014-11-10 23:23:02 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2014-11-10 23:23:02 +0000 |
commit | 497b07c1c3563efdfc147b22bd8afd094caf619a (patch) | |
tree | 9dd060a249b450e24cbd2602301cecd4f75cb27e /src/command | |
parent | 5d59d17642848ddd8b969cb59b120a65b9d98241 (diff) | |
download | profani-tty-497b07c1c3563efdfc147b22bd8afd094caf619a.tar.gz |
Added /roster show|hide command, only show roster on connect success
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/command.c | 10 | ||||
-rw-r--r-- | src/command/commands.c | 12 |
2 files changed, 19 insertions, 3 deletions
diff --git a/src/command/command.c b/src/command/command.c index 3300097f..a8b409d7 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -169,11 +169,13 @@ static struct cmd_t command_defs[] = { "/roster", cmd_roster, parse_args_with_freetext, 0, 3, NULL, - { "/roster [add|remove|nick|clearnick] [jid] [nickname]", "Manage your roster.", - { "/roster [add|remove|nick|clearnick] [jid] [nickname]", - "----------------------------------------------------", + { "/roster [show|hide|add|remove|nick|clearnick] [jid] [nickname]", "Manage your roster.", + { "/roster [show|hide|add|remove|nick|clearnick] [jid] [nickname]", + "--------------------------------------------------------------", "View, add to, and remove from your roster.", "Passing no arguments lists all contacts in your roster.", + "The 'show' command will show the roster panel in the console window.", + "The 'hide' command will hide the roster panel.", "The 'add' command will add a new item, jid is required, nickname is optional.", "The 'remove' command removes a contact, jid is required.", "The 'nick' command changes a contacts nickname, both jid and nickname are required,", @@ -1230,6 +1232,8 @@ cmd_init(void) autocomplete_add(roster_ac, "nick"); autocomplete_add(roster_ac, "clearnick"); autocomplete_add(roster_ac, "remove"); + autocomplete_add(roster_ac, "show"); + autocomplete_add(roster_ac, "hide"); group_ac = autocomplete_new(); autocomplete_add(group_ac, "show"); diff --git a/src/command/commands.c b/src/command/commands.c index 98ebe90c..877b6857 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1330,6 +1330,18 @@ cmd_roster(gchar **args, struct cmd_help_t help) cons_show_roster(list); return TRUE; + // show/hide roster + } else if (g_strcmp0(args[0], "show") == 0) { + cons_show("Roster enabled."); + prefs_set_boolean(PREF_ROSTER, TRUE); + ui_show_roster(); + return TRUE; + } else if (g_strcmp0(args[0], "hide") == 0) { + cons_show("Roster disabled."); + prefs_set_boolean(PREF_ROSTER, FALSE); + ui_hide_roster(); + return TRUE; + // add contact } else if (strcmp(args[0], "add") == 0) { char *jid = args[1]; |