Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13966418
D9123.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9123.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Oct 17 2024, 7:57 AM (4 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6721248
Default Alt Text
D9123.diff (1 KB)
Attached To
Mode
D9123: If PhabricatorIRCBot encounters a 'nick used' error, try adding a number
Attached
Detach File
Event Timeline
Log In to Comment