mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-19 22:36:22 +00:00
Add /roster color command
`/roster color on|off` to enable or disable XEP-0392 also for the roster. Regards https://github.com/profanity-im/profanity/issues/1191
This commit is contained in:
@@ -433,6 +433,7 @@ cmd_ac_init(void)
|
||||
autocomplete_add(roster_ac, "hide");
|
||||
autocomplete_add(roster_ac, "by");
|
||||
autocomplete_add(roster_ac, "count");
|
||||
autocomplete_add(roster_ac, "color");
|
||||
autocomplete_add(roster_ac, "order");
|
||||
autocomplete_add(roster_ac, "unread");
|
||||
autocomplete_add(roster_ac, "room");
|
||||
@@ -1821,6 +1822,10 @@ _roster_autocomplete(ProfWin *window, const char *const input, gboolean previous
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
result = autocomplete_param_with_func(input, "/roster color", prefs_autocomplete_boolean_choice, previous);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
result = autocomplete_param_with_ac(input, "/roster remove_all", roster_remove_all_ac, TRUE, previous);
|
||||
|
||||
@@ -280,6 +280,7 @@ static struct cmd_t command_defs[] =
|
||||
"/roster by group|presence|none",
|
||||
"/roster count unread|items|off",
|
||||
"/roster count zero on|off",
|
||||
"/roster color on|off",
|
||||
"/roster order name|presence",
|
||||
"/roster unread before|after|off",
|
||||
"/roster room char <char>|none",
|
||||
@@ -341,6 +342,8 @@ static struct cmd_t command_defs[] =
|
||||
{ "count off", "Do not show any count with roster headers." },
|
||||
{ "count zero on", "Show roster header count when 0." },
|
||||
{ "count zero off", "Hide roster header count when 0." },
|
||||
{ "color on", "Enable generated color names (XEP-0392)" },
|
||||
{ "color off", "Disable generated color names (XEP-0392)" },
|
||||
{ "order name", "Order roster contacts by name only." },
|
||||
{ "order presence", "Order roster contacts by presence, and then by name." },
|
||||
{ "unread before", "Show unread message count before contact." },
|
||||
|
||||
@@ -2739,6 +2739,11 @@ cmd_roster(ProfWin *window, const char *const command, gchar **args)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
} else if (g_strcmp0(args[0], "color") == 0) {
|
||||
_cmd_set_boolean_preference(args[1], command, "Roster consistent colors", PREF_ROSTER_COLOR_NICK);
|
||||
ui_show_roster();
|
||||
return TRUE;
|
||||
|
||||
} else if (g_strcmp0(args[0], "unread") == 0) {
|
||||
if (g_strcmp0(args[1], "before") == 0) {
|
||||
cons_show("Roster unread message count: before");
|
||||
|
||||
Reference in New Issue
Block a user