improve callback update status
This commit is contained in:
parent
eef74f1e9c
commit
3d19c4decb
|
@ -120,14 +120,22 @@ use Monolog\Logger;
|
|||
return false;
|
||||
}
|
||||
|
||||
//Do not update if current status is delivered or failed
|
||||
if (\models\Sended::STATUS_DELIVERED === $sended['status'] || \models\Sended::STATUS_FAILED === $sended['status'])
|
||||
//Do not update if current status is delivered
|
||||
if (\models\Sended::STATUS_DELIVERED === $sended['status'])
|
||||
{
|
||||
$this->logger->info('Callback status update message ignore because status is already ' . $sended['status'] . '.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//Do not update if current status is failed and new status is unknown
|
||||
if (\models\Sended::STATUS_FAILED === $sended['status'] && \models\Sended::STATUS_UNKNOWN == $callback_return['status'])
|
||||
{
|
||||
$this->logger->info('Callback status update message ignore because status is already ' . $sended['status'] . ' and new status is ' . $callback_return['status'] . '.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$this->logger->info('Callback status update message with uid ' . $callback_return['uid'] . ' to ' . $callback_return['status'] . '.');
|
||||
$this->internal_sended->update_status_for_user($this->user['id'], $sended['id'], $callback_return['status']);
|
||||
|
||||
|
|
Loading…
Reference in New Issue