1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-11-03 19:37:16 -05:00

Add /roster room use autocompletion

This commit is contained in:
Michael Vetter 2020-01-23 16:55:45 +01:00
parent 9e35861001
commit abc37c5255

View File

@ -159,6 +159,7 @@ static Autocomplete roster_char_ac;
static Autocomplete roster_remove_all_ac;
static Autocomplete roster_room_ac;
static Autocomplete roster_room_show_ac;
static Autocomplete roster_room_use_ac;
static Autocomplete roster_room_position_ac;
static Autocomplete roster_room_by_ac;
static Autocomplete roster_room_order_ac;
@ -510,6 +511,7 @@ cmd_ac_init(void)
autocomplete_add(roster_room_ac, "private");
autocomplete_add(roster_room_ac, "show");
autocomplete_add(roster_room_ac, "hide");
autocomplete_add(roster_room_ac, "use");
roster_room_show_ac = autocomplete_new();
autocomplete_add(roster_room_show_ac, "server");
@ -518,6 +520,10 @@ cmd_ac_init(void)
autocomplete_add(roster_room_by_ac, "service");
autocomplete_add(roster_room_by_ac, "none");
roster_room_use_ac = autocomplete_new();
autocomplete_add(roster_room_use_ac, "jid");
autocomplete_add(roster_room_use_ac, "name");
roster_room_order_ac = autocomplete_new();
autocomplete_add(roster_room_order_ac, "name");
autocomplete_add(roster_room_order_ac, "unread");
@ -1148,6 +1154,7 @@ cmd_ac_reset(ProfWin *window)
autocomplete_reset(roster_order_ac);
autocomplete_reset(roster_room_ac);
autocomplete_reset(roster_room_show_ac);
autocomplete_reset(roster_room_use_ac);
autocomplete_reset(roster_room_by_ac);
autocomplete_reset(roster_unread_ac);
autocomplete_reset(roster_room_position_ac);
@ -1290,6 +1297,7 @@ cmd_ac_uninit(void)
autocomplete_free(roster_order_ac);
autocomplete_free(roster_room_ac);
autocomplete_free(roster_room_show_ac);
autocomplete_free(roster_room_use_ac);
autocomplete_free(roster_room_by_ac);
autocomplete_free(roster_unread_ac);
autocomplete_free(roster_room_position_ac);
@ -1783,6 +1791,10 @@ _roster_autocomplete(ProfWin *window, const char *const input, gboolean previous
if (result) {
return result;
}
result = autocomplete_param_with_ac(input, "/roster room use", roster_room_use_ac, TRUE, previous);
if (result) {
return result;
}
result = autocomplete_param_with_func(input, "/roster count zero", prefs_autocomplete_boolean_choice, previous);
if (result) {
return result;