Deprecate backlog_no_timestamp parameter

backlog_timestamp must be used instead.

The default behavior is unchanged and can explicitly used with:

    backlog_timestamp = "time";

The "none" value can be used with the backlog_timestamp parameter in
order to use the same behavior that the "no" value of the deprecated
parameter backlog_no_timestamp provided.

The date can now be displayed (in addition to the time) while backlogging:

    backlog_timestamp = "datetime";
This commit is contained in:
Pierre-Louis Bonicoli 2021-10-08 18:02:54 +02:00
parent 8b343aa5b0
commit 0c1881b921
Signed by: pilou
GPG Key ID: 06914C4A5EDAA6DD
3 changed files with 26 additions and 6 deletions

7
NEWS
View File

@ -1,3 +1,10 @@
2021-10-08 (0.9.0)
Visible changes:
- "backlog_no_timestamp" is deprecated, "backlog_timestamp" should be used
instead. The allowed values for this new parameter are: "none", "time",
"datetime". "time" is the default value and allow to keep the default
behavior.
2009-01-24 (0.8.x)
Visible changes:
- One logfile per nick for queries, instead of the messy privates.x.log

View File

@ -181,8 +181,11 @@
# when no client attached anymore.
#backlog_always = false;
# When true, disables time stamps if you find them ugly.
#backlog_no_timestamp = false;
# "none", "time" or "datetime": disables time stamps, use time or datetime.
#backlog_timestamp = "time";
# This parameter is deprecated, use backlog_timestamp instead.
#backlog_no_timestamp = false; # implies backlog_timestamp = "none";
# If blreset_on_talk talking on an irc network has the same effect of
# issuing /bip blreset <current window>, meaning that stuffed logged

View File

@ -124,10 +124,11 @@ my %optdesc = (
'depends' => 'backlog', 'depval' => 'true',
'desc' => 'How much line do you want bip to play back upon client connect' .
" {0 => replay everything since backlog's last reset} ?" },
'backlog_no_timestamp' => { 'type' => 'b', 'adv' => 0,
'backlog_timestamp' => { 'type' => 's', 'adv' => 0,
'optional' => 1,
'default' => 'false', 'depends' => 'backlog', 'depval' => 'true',
'desc' => 'Disable timestamp in backlog ?' },
'default' => 'time', 'depends' => 'backlog', 'depval' => 'true',
'desc' => 'Use time, datetime or disable prefix in backlog',
'values' => ['none', 'time', 'datetime'] },
'backlog_msg_only' => { 'type' => 'b', 'adv' => 0,
'optional' => 1,
'default' => 'false', 'depends' => 'backlog', 'depval' => 'true',
@ -248,7 +249,7 @@ my %optorder = (
undef,
'backlog' ,
'backlog_lines' ,
'backlog_no_timestamp' ,
'backlog_timestamp' ,
'backlog_msg_only' ,
'backlog_always' ,
'backlog_reset_on_talk' ,
@ -313,6 +314,10 @@ sub askOpt {
} else {
$o = askval($e->{'desc'}, $sel, ($mayempty && ($opt ne 1 ||
$e->{'type'} eq 'i' ? 1 : undef)), 1);
if (defined $e->{'values'} && !grep(/^$o$/, @{$e->{'values'}})) {
print("The allowed values are '@{[ join '\', \'', @{$e->{'values'}} ]}'\n");
next;
}
}
if ($o eq undef && $opt eq 0) {
print("This value is mandatory, please enter a value\n");
@ -462,6 +467,11 @@ sub loadConfig {
$_->{'server'} = [ values %{$_->{'server'}} ];
}
foreach my $tcu (@{$cf{'users'}}) {
my $backlog_no_timestamp = delete($tcu->{'backlog_no_timestamp'});
if (defined $backlog_no_timestamp) {
grep(/^$backlog_no_timestamp$/, ('false', 'true')) || return "Invalid value for backlog_no_timestamp: '$backlog_no_timestamp'";
$tcu->{'backlog_timestamp'} = $backlog_no_timestamp == 'false' ? 'time' : 'none';
}
$tcu->{'connection'} = [ values %{$tcu->{'connection'}} ];
foreach my $tcc (@{$tcu->{'connection'}}) {
$tcc->{'channel'} = [ values %{$tcc->{'channel'}} ];