MessageLib -> sendMessage: if no sender_id is specified the system default person_id will be used

This commit is contained in:
bison-paolo
2016-10-04 18:19:39 +02:00
parent 863d6af4eb
commit 1feec909cb
3 changed files with 5 additions and 6 deletions
@@ -132,7 +132,7 @@ class Message extends APIv1_Controller
if (is_object($validation) && $validation->error == EXIT_SUCCESS)
{
$result = $this->messagelib->sendMessage(
$this->post()['person_id'],
isset($this->post()['person_id']) ? $this->post()['person_id'] : null,
isset($this->post()['receiver_id']) ? $this->post()['receiver_id'] : null,
$this->post()['subject'],
$this->post()['body'],
@@ -204,10 +204,6 @@ class Message extends APIv1_Controller
{
return $this->_error('Parameter is null');
}
if (!isset($message['person_id']))
{
return $this->_error('person_id is not set');
}
if (!isset($message['subject']))
{
return $this->_error('subject is not set');