]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/ItemDeliveryData.php
Raw content is now stored with announce messages as well
[friendica.git] / src / Model / ItemDeliveryData.php
index f007537f99c02d687754ae50af8dfaf24996b779..a26c80b1cb1f356a18f3a01f9b70f887362995ae 100644 (file)
@@ -1,7 +1,22 @@
 <?php
-
 /**
- * @file src/Model/ItemDeliveryData.php
+ * @copyright Copyright (C) 2020, Friendica
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
  */
 
 namespace Friendica\Model;
@@ -29,6 +44,7 @@ class ItemDeliveryData
        const LEGACY_DFRN = 3;
        const DIASPORA = 4;
        const OSTATUS = 5;
+       const MAIL = 6;
 
        /**
         * Extract delivery data from the provided item fields
@@ -103,6 +119,19 @@ class ItemDeliveryData
                return DBA::e('UPDATE `item-delivery-data` SET `queue_failed` = `queue_failed` + 1 WHERE `iid` = ?', $item_id);
        }
 
+       /**
+        * Increments the queue_count for the given item ID.
+        *
+        * @param integer $item_id
+        * @param integer $increment
+        * @return bool
+        * @throws \Exception
+        */
+       public static function incrementQueueCount(int $item_id, int $increment = 1)
+       {
+               return DBA::e('UPDATE `item-delivery-data` SET `queue_count` = `queue_count` + ? WHERE `iid` = ?', $increment, $item_id);
+       }
+
        /**
         * Insert a new item delivery data entry
         *