getCommand()) { case 'PRIVMSG': $channel = $message->getChannel(); if (!$channel) { break; } $message = $message->getMessageText(); $matches = null; $phids = array(); if (preg_match_all('/(?:^|\b)D(\d+)(?:\b|$)/', $message, $matches)) { if ($matches[1]) { $revisions = $this->getConduit()->callMethodSynchronous( 'differential.find', array( 'query' => 'revision-ids', 'guids' => $matches[1], )); // TODO: This is utter hacks until phid.find or similar lands. foreach ($revisions as $revision) { $phids[$revision['phid']] = 'D'.$revision['id'].' '.$revision['name'].' - '. PhabricatorEnv::getProductionURI('/D'.$revision['id']); } } } foreach ($phids as $phid => $description) { $this->write('PRIVMSG', "{$channel} :{$description}"); } break; } } }