Commit 49d52092 authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Fix RocketChat notification

parent 6094465d
......@@ -168,7 +168,7 @@ class PublishManager
if ((!($this->layout->article['published_ts'])>0) || $param=="new")
{
$a->PublishedSet();
$this->ArticleNotify($id_article, $url, $this->layout->article['headline']);
$this->ArticleNotify($id_article, $url);
}
include_once(SERVER_ROOT."/../classes/twitter.php");
$tw = new TwitterHelper();
......@@ -187,16 +187,18 @@ class PublishManager
unset($this->layout->article);
}
private function ArticleNotify($id_article,$url,$headline) {
private function ArticleNotify($id_article,$url) {
include_once(SERVER_ROOT."/../classes/contribution.php");
$co = new Contribution("article");
$co->Notify($id_article,$url,$headline);
$co->Notify($id_article, $url, $this->layout->article['headline']);
$conf = new Configuration();
if($conf->Get("rocketchat_webhook")!='') {
$webhook = parse_url($conf->Get("rocketchat_webhook"));
$data = array();
$data['url'] = $url;
$data['title'] = $headline;
$data['title'] = $this->layout->article['headline'];
$data['topic'] = $this->layout->topic->name;
$data['id_topic_group'] = $this->layout->topic->id_group;
$this->fm->PostData("{$webhook['scheme']}://{$webhook['host']}", $webhook['path'], $data, false, 15, true);
}
}
......@@ -1203,7 +1205,7 @@ class PublishManager
if (!($this->layout->article['published_ts'])>0)
{
$a->PublishedSet();
$this->ArticleNotify($article['id_article'], $url, $this->layout->article['headline']);
$this->ArticleNotify($article['id_article'], $url);
}
}
unset($a);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment