1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-06-23 21:45:30 +00:00

Complete no arg for /role set

This commit is contained in:
James Booth 2016-05-24 01:44:56 +01:00
parent e8b2578039
commit b574919738

View File

@ -2318,13 +2318,15 @@ _role_autocomplete(ProfWin *window, const char *const input)
gboolean parse_result;
Autocomplete nick_ac = muc_roster_ac(mucwin->roomjid);
gchar **args = parse_args(input, 3, 3, &parse_result);
gchar **args = parse_args(input, 2, 3, &parse_result);
if ((strncmp(input, "/role", 5) == 0) && (parse_result == TRUE)) {
GString *beginning = g_string_new("/role ");
g_string_append(beginning, args[0]);
g_string_append(beginning, " ");
g_string_append(beginning, args[1]);
if (args[1]) {
g_string_append(beginning, args[1]);
}
result = autocomplete_param_with_ac(input, beginning->str, nick_ac, TRUE);
g_string_free(beginning, TRUE);