1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

added the support for slowvote links from the bot

This commit is contained in:
moos3 2011-08-23 21:17:27 -04:00
parent 556531cb1c
commit dd9b15600a

View file

@ -45,7 +45,7 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
$pattern =
'@'.
'(?<!/)(?:^|\b)'. // Negative lookbehind prevent matching "/D123".
'(D|T|P)(\d+)'.
'(D|T|P|V)(\d+)'.
'(?:\b|$)'.
'@';
@ -66,6 +66,9 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
case 'P':
$paste_ids[] = $match[2];
break;
case 'V':
$vote_idsp[] = $match[2];
break;
}
}
}
@ -110,6 +113,18 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
}
}
if ($vote_ids) {
foreach ($vote_ids as $vote_id) {
$vote = $this->getConduit()->callMethodSynchronous(
'slowvote.info',
array(
'poll_id' => $vote_id,
));
$output[$vote['phid']] = 'V'.$vote['id'].':'.$vote['question'].
' Come Vote '.$vote['uri'];
}
}
if ($paste_ids) {
foreach ($paste_ids as $paste_id) {
$paste = $this->getConduit()->callMethodSynchronous(