mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-21 04:50:55 +01:00
Added Fn directive to IRCbot D1456
This commit is contained in:
parent
7f9fb3597d
commit
f6a78452f3
1 changed files with 17 additions and 1 deletions
|
@ -46,7 +46,7 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
|
||||||
$pattern =
|
$pattern =
|
||||||
'@'.
|
'@'.
|
||||||
'(?<!/)(?:^|\b)'. // Negative lookbehind prevent matching "/D123".
|
'(?<!/)(?:^|\b)'. // Negative lookbehind prevent matching "/D123".
|
||||||
'(D|T|P|V)(\d+)'.
|
'(D|T|P|V|F)(\d+)'.
|
||||||
'(?:\b|$)'.
|
'(?:\b|$)'.
|
||||||
'@';
|
'@';
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
|
||||||
$paste_ids = array();
|
$paste_ids = array();
|
||||||
$commit_names = array();
|
$commit_names = array();
|
||||||
$vote_ids = array();
|
$vote_ids = array();
|
||||||
|
$file_ids = array();
|
||||||
|
|
||||||
if (preg_match_all($pattern, $message, $matches, PREG_SET_ORDER)) {
|
if (preg_match_all($pattern, $message, $matches, PREG_SET_ORDER)) {
|
||||||
foreach ($matches as $match) {
|
foreach ($matches as $match) {
|
||||||
|
@ -71,6 +72,9 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
|
||||||
case 'V':
|
case 'V':
|
||||||
$vote_ids[] = $match[2];
|
$vote_ids[] = $match[2];
|
||||||
break;
|
break;
|
||||||
|
case 'F':
|
||||||
|
$file_ids[] = $match[2];
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,6 +130,18 @@ class PhabricatorIRCObjectNameHandler extends PhabricatorIRCHandler {
|
||||||
' Come Vote '.$vote['uri'];
|
' Come Vote '.$vote['uri'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($file_ids) {
|
||||||
|
foreach ($file_ids as $file_id) {
|
||||||
|
$file = $this->getConduit()->callMethodSynchronous(
|
||||||
|
'file.info',
|
||||||
|
array(
|
||||||
|
'id' => $file_id,
|
||||||
|
));
|
||||||
|
$output[$file['phid']] = $file['objectName'].": ".$file['uri']." - ".
|
||||||
|
$file['name'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($paste_ids) {
|
if ($paste_ids) {
|
||||||
foreach ($paste_ids as $paste_id) {
|
foreach ($paste_ids as $paste_id) {
|
||||||
|
|
Loading…
Reference in a new issue