Added method postChangeStatus to controller Message

This commit is contained in:
paolo
2016-06-28 18:13:20 +02:00
parent bcc42f2b02
commit a68dfa7ba2
2 changed files with 34 additions and 13 deletions
@@ -119,6 +119,28 @@ class Message extends APIv1_Controller
}
}
/**
* @return void
*/
public function postChangeStatus()
{
$person_id = $this->post()['person_id'];
$message_id = $this->post()['message_id'];
$status = $this->post()['status'];
if (isset($person_id) && isset($message_id) && isset($status) &&
in_array($status, array(MSG_STATUS_UNREAD, MSG_STATUS_READ, MSG_STATUS_ARCHIVED, MSG_STATUS_DELETED)))
{
$result = $this->messagelib->updateMessageStatus($message_id, $person_id, $status);
$this->response($result, REST_Controller::HTTP_OK);
}
else
{
$this->response();
}
}
private function _validatePostMessage($message = null)
{
if (!isset($message))