]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Delivery.php
BBCode - fixed syntax error
[friendica.git] / src / Worker / Delivery.php
index 191692a90608eb26b1554895f6256c9710daf8d0..8e9b649c7b57556da982a6e7e82a4e95d2c85a83 100644 (file)
@@ -94,7 +94,7 @@ class Delivery extends BaseObject
                        } elseif (!empty($target_item['uid'])) {
                                $uid = $target_item['uid'];
                        } else {
-                               Logger::log('Only public users for item ' . $item_id, Logger::DEBUG);
+                               Logger::log('Only public users for item ' . $target_id, Logger::DEBUG);
                                return;
                        }
 
@@ -210,10 +210,6 @@ class Delivery extends BaseObject
 
                        case Protocol::MAIL:
                                self::deliverMail($cmd, $contact, $owner, $target_item);
-
-                               if (in_array($cmd, [Delivery::POST, Delivery::COMMENT])) {
-                                       ItemDeliveryData::incrementQueueDone($target_id);
-                               }
                                break;
 
                        default:
@@ -234,6 +230,8 @@ class Delivery extends BaseObject
         * @param boolean $public_message Is the content public?
         * @param boolean $top_level      Is it a thread starter?
         * @param boolean $followup       Is it an answer to a remote post?
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws \ImagickException
         */
        private static function deliverDFRN($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup)
        {
@@ -303,7 +301,7 @@ class Delivery extends BaseObject
                // Se we transmit with the new method and via Diaspora as a fallback
                if (!empty($items) && (($items[0]['uid'] == 0) || ($contact['uid'] == 0))) {
                        // Transmit in public if it's a relay post
-                       $public_dfrn = ($contact['contact-type'] == Contact::ACCOUNT_TYPE_RELAY);
+                       $public_dfrn = ($contact['contact-type'] == Contact::TYPE_RELAY);
 
                        $deliver_status = DFRN::transmit($owner, $contact, $atom, $public_dfrn);
 
@@ -355,11 +353,13 @@ class Delivery extends BaseObject
         * @param boolean $public_message Is the content public?
         * @param boolean $top_level      Is it a thread starter?
         * @param boolean $followup       Is it an answer to a remote post?
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws \ImagickException
         */
        private static function deliverDiaspora($cmd, $contact, $owner, $items, $target_item, $public_message, $top_level, $followup)
        {
                // We don't treat Forum posts as "wall-to-wall" to be able to post them via Diaspora
-               $walltowall = $top_level && ($owner['id'] != $items[0]['contact-id']) & ($owner['account-type'] != Contact::ACCOUNT_TYPE_COMMUNITY);
+               $walltowall = $top_level && ($owner['id'] != $items[0]['contact-id']) & ($owner['account-type'] != User::ACCOUNT_TYPE_COMMUNITY);
 
                if ($public_message) {
                        $loc = 'public batch ' . $contact['batch'];
@@ -418,6 +418,8 @@ class Delivery extends BaseObject
         * @param array  $contact     Contact record of the receiver
         * @param array  $owner       Owner record of the sender
         * @param array  $target_item Item record of the content
+        * @throws \Friendica\Network\HTTPException\InternalServerErrorException
+        * @throws \ImagickException
         */
        private static function deliverMail($cmd, $contact, $owner, $target_item)
        {