Added the webhooks.
This commit is contained in:
@@ -288,5 +288,31 @@ class IDF_Commit extends Pluf_Model
|
||||
$email->addTextMessage($text_email);
|
||||
$email->sendMail();
|
||||
Pluf_Translation::loadSetLocale($current_locale);
|
||||
|
||||
// Now we add to the queue, soon we will push everything in
|
||||
// the queue, including email notifications and indexing.
|
||||
// Even if the url is empty, we add to the queue as some
|
||||
// plugins may want to do something with this information in
|
||||
// an asynchronous way.
|
||||
|
||||
$url = str_replace(array('%p', '%r'),
|
||||
array($project->shortname, $this->scm_id),
|
||||
$conf->getVal('webhook_url', ''));
|
||||
$payload = array('to_send' => array(
|
||||
'project' => $project->shortname,
|
||||
'rev' => $this->scm_id,
|
||||
'summary' => $this->summary,
|
||||
'fullmessage' => $this->fullmessage,
|
||||
'author' => $this->origauthor,
|
||||
'creation_date' => $this->creation_dtime,
|
||||
),
|
||||
'project_id' => $project->id,
|
||||
'authkey' => $project->getPostCommitHookKey(),
|
||||
'url' => $url,
|
||||
);
|
||||
$item = new IDF_Queue();
|
||||
$item->type = 'new_commit';
|
||||
$item->payload = $payload;
|
||||
$item->create();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user