fix(history): address PR #116 review feedback
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 31s
CI Code / Code Coverage (pull_request) Successful in 2m42s
CI Code / Linux (debian) (pull_request) Successful in 4m43s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m58s
CI Code / Linux (arch) (pull_request) Successful in 5m55s
All checks were successful
CI Code / Check spelling (pull_request) Successful in 17s
CI Code / Check coding style (pull_request) Successful in 31s
CI Code / Code Coverage (pull_request) Successful in 2m42s
CI Code / Linux (debian) (pull_request) Successful in 4m43s
CI Code / Linux (ubuntu) (pull_request) Successful in 4m58s
CI Code / Linux (arch) (pull_request) Successful in 5m55s
- console: drop orphaned `/logging chat` reference from cons_privacy_setting() — the subcommand was removed, PREF_CHLOG now tracks PREF_HISTORY implicitly - console: delete cons_logging_setting() and remove its call from cons_show_log_prefs() — every line in it referenced /logging chat or /logging group, both now invalid after the deprecation below - command: deprecate /logging command. It now prints a single notice pointing to /history; CMD_PREAMBLE trimmed (min_args=0, no setting_func, syntax/args/examples dropped); subcommand 'group' removed from autocomplete The SQLite history-load gap for /correction off is split out into a follow-up — out of scope for this PR.
This commit is contained in:
@@ -1147,8 +1147,6 @@ cmd_ac_init(void)
|
||||
autocomplete_add(status_state_ac, "xa");
|
||||
autocomplete_add(status_state_ac, "dnd");
|
||||
|
||||
autocomplete_add(logging_ac, "group");
|
||||
|
||||
autocomplete_add(privacy_ac, "logging");
|
||||
autocomplete_add(privacy_ac, "os");
|
||||
|
||||
|
||||
@@ -1660,19 +1660,14 @@ static const struct cmd_t command_defs[] = {
|
||||
},
|
||||
|
||||
{ CMD_PREAMBLE("/logging",
|
||||
parse_args, 2, 3, &cons_logging_setting)
|
||||
parse_args, 0, 3, NULL)
|
||||
CMD_MAINFUNC(cmd_logging)
|
||||
CMD_TAGS(
|
||||
CMD_TAG_CHAT)
|
||||
CMD_SYN(
|
||||
"/logging group on|off")
|
||||
"/logging")
|
||||
CMD_DESC(
|
||||
"Configure groupchat (MUC) logging. "
|
||||
"Regular chat logging is controlled by /history.")
|
||||
CMD_ARGS(
|
||||
{ "group on|off", "Enable/Disable groupchat (room) logging." })
|
||||
CMD_EXAMPLES(
|
||||
"/logging group off")
|
||||
"Deprecated. Use '/history' instead.")
|
||||
},
|
||||
|
||||
{ CMD_PREAMBLE("/states",
|
||||
|
||||
@@ -6731,17 +6731,7 @@ cmd_privacy(ProfWin* window, const char* const command, gchar** args)
|
||||
gboolean
|
||||
cmd_logging(ProfWin* window, const char* const command, gchar** args)
|
||||
{
|
||||
if (args[0] == NULL) {
|
||||
cons_logging_setting();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (g_strcmp0(args[0], "group") == 0 && args[1] != NULL) {
|
||||
_cmd_set_boolean_preference(args[1], "Groupchat logging", PREF_GRLOG);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
cons_bad_cmd_usage(command);
|
||||
cons_show("The '/logging' command is deprecated, use '/history' instead.");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1948,27 +1948,12 @@ cons_log_setting(void)
|
||||
cons_show("Log level (/log level) : %s", level);
|
||||
}
|
||||
|
||||
void
|
||||
cons_logging_setting(void)
|
||||
{
|
||||
if (prefs_get_boolean(PREF_CHLOG))
|
||||
cons_show("Chat logging (/logging chat) : ON");
|
||||
else
|
||||
cons_show("Chat logging (/logging chat) : OFF");
|
||||
|
||||
if (prefs_get_boolean(PREF_GRLOG))
|
||||
cons_show("Groupchat logging (/logging group) : ON");
|
||||
else
|
||||
cons_show("Groupchat logging (/logging group) : OFF");
|
||||
}
|
||||
|
||||
void
|
||||
cons_show_log_prefs(void)
|
||||
{
|
||||
cons_show("Logging preferences:");
|
||||
cons_show("");
|
||||
cons_log_setting();
|
||||
cons_logging_setting();
|
||||
|
||||
cons_alert(NULL);
|
||||
}
|
||||
@@ -2862,11 +2847,6 @@ cons_privacy_setting(void)
|
||||
{
|
||||
cons_show("Database logging : %s", prefs_get_string(PREF_DBLOG));
|
||||
|
||||
if (prefs_get_boolean(PREF_CHLOG)) {
|
||||
cons_show("Chat logging (/logging chat) : ON");
|
||||
} else {
|
||||
cons_show("Chat logging (/logging chat) : OFF");
|
||||
}
|
||||
if (prefs_get_boolean(PREF_HISTORY)) {
|
||||
cons_show("Chat history (/history) : ON");
|
||||
} else {
|
||||
|
||||
@@ -330,7 +330,6 @@ void cons_history_setting(void);
|
||||
void cons_carbons_setting(void);
|
||||
void cons_receipts_setting(void);
|
||||
void cons_log_setting(void);
|
||||
void cons_logging_setting(void);
|
||||
void cons_autoaway_setting(void);
|
||||
void cons_reconnect_setting(void);
|
||||
void cons_autoping_setting(void);
|
||||
|
||||
Reference in New Issue
Block a user