added the ability for the irc nick to have a identify password. just add "nickpass":"password" to your irc_config.json file and it will identify on connect"

This commit is contained in:
moos3
2011-08-22 17:04:22 -04:00
committed by epriestley
parent bd2b557b42
commit 2d677d3992

View File

@@ -56,6 +56,8 @@ final class PhabricatorIRCBot extends PhabricatorDaemon {
$pass = idx($config, 'pass'); $pass = idx($config, 'pass');
$nick = idx($config, 'nick', 'phabot'); $nick = idx($config, 'nick', 'phabot');
$user = idx($config, 'user', $nick); $user = idx($config, 'user', $nick);
$ssl = idx($config, 'ssl', false);
$nickpass = idx($config, 'nickpass');
if (!preg_match('/^[A-Za-z0-9_`[{}^|\]\\-]+$/', $nick)) { if (!preg_match('/^[A-Za-z0-9_`[{}^|\]\\-]+$/', $nick)) {
throw new Exception( throw new Exception(
@@ -107,6 +109,10 @@ final class PhabricatorIRCBot extends PhabricatorDaemon {
$this->writeCommand('PASS', "{$pass}"); $this->writeCommand('PASS', "{$pass}");
} }
if ($nickpass) {
$this->writeCommand("NickServ IDENTIFY ", "{$nickpass}");
}
$this->writeCommand('NICK', "{$nick}"); $this->writeCommand('NICK', "{$nick}");
foreach ($join as $channel) { foreach ($join as $channel) {
$this->writeCommand('JOIN', "{$channel}"); $this->writeCommand('JOIN', "{$channel}");