Commit b8f275f8 authored by ramiandrison gova's avatar ramiandrison gova
Browse files

Merge branch 'master' into qa

parents 9b3f29ea 002d0c6e
......@@ -4,6 +4,8 @@ namespace PixelHumain\PixelHumain\modules\news\controllers\actions;
use CAction;
use News;
use Person;
use PixelHumain\PixelHumain\modules\citizenToolKit\components\activitypub\handlers\Handler;
use PixelHumain\PixelHumain\modules\citizenToolKit\models\activitypub\Activitypub;
use Rest;
use Yii;
......@@ -15,6 +17,11 @@ class SaveAction extends \PixelHumain\PixelHumain\components\Action
$result=array("result"=>false, "msg"=>Yii::t("common","You must be logged in to add a news entry !"));
if(Person::logguedAndValid()){
$result=News::save($_POST);
$user = Person::getById(Yii::app()->session["userId"]);
if(isset($user["preferences"]["notifications"]["desableActivitypub"]))
Handler::handle(Activitypub::createNoteActivity($_POST), ["newsId"=>(string)$result["object"]["_id"]]);
if(!@$_REQUEST["json"]){
$params=array(
"news"=>array( (string)$result["id"]=>$result["object"]),
......
Supports Markdown
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