3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 13:59:47 +01:00

Users: fix issues

This commit is contained in:
Pragmatic Software 2020-01-25 14:31:10 -08:00
parent 7322906e5d
commit 3e031f3874

View File

@ -388,7 +388,7 @@ sub userset {
($channel, $hostmask) = $self->find_user_account($channel, $hostmask); ($channel, $hostmask) = $self->find_user_account($channel, $hostmask);
my $result = $self->{users}->set($channel, $hostmask, $key, $value); my $result = $self->{users}->set($channel, $hostmask, $key, $value);
$result =~ s/^password => .*;$/password => <private>;/m; $result =~ s/^password => .*;?$/password => <private>;/m;
return $result; return $result;
} }
@ -438,9 +438,11 @@ sub mycmd {
if (not $u) { if (not $u) {
$channel = '.*'; $channel = '.*';
$hostmask = "$nick!*\@*"; $hostmask = "$nick!*\@*";
$u = $self->add_user("my_$nick", $channel, $hostmask); $u = $self->add_user("my_$nick", $channel, $hostmask, undef, undef, 1);
$u->{autologin} = 1;
$u->{loggedin} = 1; $u->{loggedin} = 1;
$u->{stayloggedin} = 1;
$u->{autologin} = 1;
$self->save;
} }
if (defined $value and $u->{level} == 0) { if (defined $value and $u->{level} == 0) {
@ -450,10 +452,9 @@ sub mycmd {
} }
} }
($channel, $hostmask) = $self->find_user_account($channel, $hostmask); ($channel, $hostmask) = $self->find_user_account($channel, $hostmask);
my $result = $self->{users}->set($channel, $hostmask, $key, $value); my $result = $self->{users}->set($channel, $hostmask, $key, $value);
$result =~ s/^password => .*;$/password => <private>;/m; $result =~ s/^password => .*;?$/password => <private>;/m;
return $result; return $result;
} }