* server:nspass removed. server:idstr added.
* Changed the way we parse strings to support multi-word
strings in config values.
This commit is contained in:
1 parent
a4317ecec7
commit
ed65193529
3 files changed
+35
-5
No files matched your search
@@ -3,6 +3,9 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
==================================================================
|
==================================================================
|
||||||
|
* server:nspass removed. server:idstr added.
|
||||||
|
* Changed the way we parse strings to support multi-word
|
||||||
|
strings in config values.
|
||||||
* Added server:nspass to config options. Will be replaced in
|
* Added server:nspass to config options. Will be replaced in
|
||||||
the future by idstr.
|
the future by idstr.
|
||||||
* Parse NICK.
|
* Parse NICK.
|
||||||
|
|||||||
+29
-2
@@ -67,9 +67,36 @@ sub parse
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
my $param = $ebuf[1];
|
my $param = $ebuf[1];
|
||||||
$param =~ s/"//g;
|
|
||||||
my @param = ($param);
|
|
||||||
|
|
||||||
|
if (substr($param, 0, 1) eq '"' and substr($param, length($param) - 1, 1) ne '"') {
|
||||||
|
# Multi-word string.
|
||||||
|
$param = substr($param, 1);
|
||||||
|
|
||||||
|
for (my $i = 2; $i < scalar(@ebuf); $i++) {
|
||||||
|
if (substr($ebuf[$i], length($ebuf[$i]) - 1, 1) eq '"') {
|
||||||
|
$param .= " ".substr($ebuf[$i], 0, length($ebuf[$i]) - 1);
|
||||||
|
last;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$param .= " ".$ebuf[$i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
elsif (substr($param, 0, 1) eq '"' and substr($param, length($param) - 1, 1) eq '"') {
|
||||||
|
# Single-word string.
|
||||||
|
$param = substr($param, 1, length($ebuf[1]) - 2);
|
||||||
|
}
|
||||||
|
elsif ($param =~ m/[0-9]/) {
|
||||||
|
# Numeric.
|
||||||
|
$param =~ s/[^0-9.]//g;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
# Garbage.
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
|
||||||
|
my @param = ($param);
|
||||||
|
|
||||||
unless (!$blk) {
|
unless (!$blk) {
|
||||||
# We're inside a block.
|
# We're inside a block.
|
||||||
if ($blk =~ m/@@@/) {
|
if ($blk =~ m/@@@/) {
|
||||||
|
|||||||
+3
-3
@@ -57,9 +57,9 @@ sub num001
|
|||||||
$got_001{$svr} = 1;
|
$got_001{$svr} = 1;
|
||||||
|
|
||||||
# Identify string.
|
# Identify string.
|
||||||
unless (!conf_get("server:$svr:nspass")) {
|
unless (!conf_get("server:$svr:idstr")) {
|
||||||
my $nspass = (conf_get("server:$svr:nspass"))[0][0];
|
my $idstr = (conf_get("server:$svr:idstr"))[0][0];
|
||||||
Auto::socksnd($svr, "PRIVMSG NickServ :IDENTIFY $nspass");
|
Auto::socksnd($svr, $idstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get the auto-join from the config.
|
# Get the auto-join from the config.
|
||||||
|
|||||||
Reference in new issue
Block a user