]> git.mxchange.org Git - friendica.git/commitdiff
enotify: empty out fields instead of using "abort" for addons
authornupplaPhil <admin@philipp.info>
Tue, 28 Jan 2020 00:12:41 +0000 (01:12 +0100)
committernupplaPhil <admin@philipp.info>
Tue, 28 Jan 2020 17:41:46 +0000 (18:41 +0100)
src/Repository/Notify.php

index 5f2d9f8a7fa5bc344fc6d50d11b848dd22b713ce..9552eddb9ae5ac6bbd072ce4f79f4c59ad47bc36 100644 (file)
@@ -67,7 +67,7 @@ class Notify extends BaseRepository
        /**
         * @param array $fields
         *
-        * @return Model\Notify
+        * @return Model\Notify|false
         *
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws Exception
@@ -75,17 +75,14 @@ class Notify extends BaseRepository
        public function insert(array $fields)
        {
                $fields['date']  = DateTimeFormat::utcNow();
-               $fields['abort'] = false;
 
                Hook::callAll('enotify_store', $fields);
 
-               if ($fields['abort']) {
+               if (empty($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]);
 
                return parent::insert($fields);