Page MenuHomePhabricator

D9123.diff
No OneTemporary

D9123.diff

diff --git a/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php b/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php
--- a/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php
+++ b/src/infrastructure/daemon/bot/adapter/PhabricatorIRCProtocolAdapter.php
@@ -8,6 +8,8 @@
private $writeBuffer;
private $readBuffer;
+ private $nickIncrement = 0;
+
public function getServiceType() {
return 'IRC';
}
@@ -183,6 +185,12 @@
private function handleIRCProtocol(array $matches) {
$data = $matches['data'];
switch ($matches['command']) {
+ case '433': // Nickname already in use
+ // If we receive this error, try appending "-1", "-2", etc. to the nick
+ $this->nickIncrement++;
+ $nick = $this->getConfig('nick', 'phabot').'-'.$this->nickIncrement;
+ $this->write("NICK {$nick}");
+ return true;
case '422': // Error - no MOTD
case '376': // End of MOTD
$nickpass = $this->getConfig('nickpass');

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 8:51 PM (1 d, 9 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6721248
Default Alt Text
D9123.diff (1 KB)

Event Timeline