diff options
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/command.c | 8 | ||||
-rw-r--r-- | src/command/commands.c | 12 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/command/command.c b/src/command/command.c index 587fd241..7a87d828 100644 --- a/src/command/command.c +++ b/src/command/command.c @@ -279,6 +279,7 @@ static struct cmd_t command_defs[] = "/roster by group|presence|none", "/roster order name|presence", "/roster char header <char>|none", + "/roster char contact <char>|none", "/roster size <percent>", "/roster add <jid> [<nick>]", "/roster remove <jid>", @@ -313,6 +314,8 @@ static struct cmd_t command_defs[] = { "order presence", "Order roster items by presence, and then by name." }, { "char header <char>", "Prefix roster headers with specificed character." }, { "char header none", "Remove roster header character prefix." }, + { "char contact <char>", "Prefix roster contacts with specificed character." }, + { "char contact none", "Remove roster contact character prefix." }, { "size <precent>", "Percentage of the screen taken up by the roster (1-99)." }, { "add <jid> [<nick>]", "Add a new item to the roster." }, { "remove <jid>", "Removes an item from the roster." }, @@ -2033,6 +2036,7 @@ cmd_init(void) roster_char_ac = autocomplete_new(); autocomplete_add(roster_char_ac, "header"); + autocomplete_add(roster_char_ac, "contact"); roster_char_none_ac = autocomplete_new(); autocomplete_add(roster_char_none_ac, "none"); @@ -2890,6 +2894,10 @@ _roster_autocomplete(ProfWin *window, const char *const input) if (result) { return result; } + result = autocomplete_param_with_ac(input, "/roster char contact", roster_char_none_ac, TRUE); + if (result) { + return result; + } result = autocomplete_param_with_func(input, "/roster nick", roster_barejid_autocomplete); if (result) { return result; diff --git a/src/command/commands.c b/src/command/commands.c index 7f67e19d..ca6a1003 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -1764,6 +1764,18 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args) cons_show("Roster header char set to %c.", args[2][0]); rosterwin_roster(); } + } else if (g_strcmp0(args[1], "contact") == 0) { + if (!args[2]) { + cons_bad_cmd_usage(command); + } else if (g_strcmp0(args[2], "none") == 0) { + prefs_clear_roster_contact_char(); + cons_show("Roster contact char removed."); + rosterwin_roster(); + } else { + prefs_set_roster_contact_char(args[2][0]); + cons_show("Roster contact char set to %c.", args[2][0]); + rosterwin_roster(); + } } else { cons_bad_cmd_usage(command); } |