mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-19 03:50:54 +01:00
added the support for slowvote links from the bot
This commit is contained in:
parent
556531cb1c
commit
dd9b15600a
1 changed files with 16 additions and 1 deletions
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue