diff --git a/bin/auto b/bin/auto index a94cb4f..0bb7ef0 100755 --- a/bin/auto +++ b/bin/auto @@ -184,6 +184,7 @@ if (conf_get("module")) { } ## Create sockets. +API::Std::event_add("on_preconnect"); alog "* Connecting to servers..."; dbug "* Connecting to servers..."; # Get servers from config. @@ -207,6 +208,7 @@ foreach my $cskey (keys %cservers) { err(2, "Failed to connect to server: ".$cskey." [".$cservers{$cskey}{'host'}[0].":".$cservers{$cskey}{'port'}[0]."]", 0) and next; } + API::Std::event_run("on_preconnect"); # Send USER and NICK. socksnd($cskey, "USER ".$cservers{$cskey}{'ident'}[0]." * * :".$cservers{$cskey}{'realname'}[0]) or err(2, "Failed to connect to server: ".$cskey." [".$cservers{$cskey}{'host'}[0].":".$cservers{$cskey}{'port'}[0]."]", 0) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index cc427e1..f96bab0 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Added hook on_preconnect, this comes before USER (after PASS). * Added match_mask() to API::IRC and match_user() to API::Std, match_user checks config user:mask to find a user block, if a match is found, the configured username is returned.