- &nick($param{'ircNick'});
- } else {
- &msg($who, "hrm.. I shouldn't do it (BUG?) but doing it anyway!");
- &DEBUG("wN: nick is somewhere... should try later.");
- &nick($param{'ircNick'});
+ &nick($param{ 'ircNick' });
+ return;
+ }
+
+ # idea from dondelecarlo :)
+ # todo: use cache{nickserv}
+ if ($param{'nickServ_pass'}) {
+ return if ($param{'ircNick'} eq $ident or $force == 0);
+
+ &status("someone is using our nick; GHOSTing");
+ &msg($who, "using GHOST on $param{'ircNick'}.");
+ &msg("NickServ", "GHOST $param{'ircNick'} $param{'nickServ_pass'}");
+
+ $conn->schedule(5, sub {
+ &status("going to change nick after GHOST.");
+ &nick( $param{'ircNick'} );
+ } );
+
+ return;