enotify: empty out fields instead of using "abort" for addons
This commit is contained in:
parent
ff9eb20663
commit
52a4010121
1 changed files with 3 additions and 6 deletions
|
@ -67,7 +67,7 @@ class Notify extends BaseRepository
|
||||||
/**
|
/**
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
*
|
*
|
||||||
* @return Model\Notify
|
* @return Model\Notify|false
|
||||||
*
|
*
|
||||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
|
@ -75,17 +75,14 @@ class Notify extends BaseRepository
|
||||||
public function insert(array $fields)
|
public function insert(array $fields)
|
||||||
{
|
{
|
||||||
$fields['date'] = DateTimeFormat::utcNow();
|
$fields['date'] = DateTimeFormat::utcNow();
|
||||||
$fields['abort'] = false;
|
|
||||||
|
|
||||||
Hook::callAll('enotify_store', $fields);
|
Hook::callAll('enotify_store', $fields);
|
||||||
|
|
||||||
if ($fields['abort']) {
|
if (empty($fields)) {
|
||||||
$this->logger->debug('Abort adding notification entry', ['fields' => $fields]);
|
$this->logger->debug('Abort adding notification entry', ['fields' => $fields]);
|
||||||
return null;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
unset($fields['abort']);
|
|
||||||
|
|
||||||
$this->logger->debug('adding notification entry', ['fields' => $fields]);
|
$this->logger->debug('adding notification entry', ['fields' => $fields]);
|
||||||
|
|
||||||
return parent::insert($fields);
|
return parent::insert($fields);
|
||||||
|
|
Loading…
Reference in a new issue