]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Item.php
Support for message delivering via uri-id
[friendica.git] / src / Model / Item.php
index 6114457d64bf362256c4452e9c3feceba49aa006..28e0e25f4cca7e3b3e929d60cbdb44a3d59119ac 100644 (file)
@@ -77,7 +77,7 @@ class Item
                'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink',
                'wall', 'private', 'starred', 'origin', 'title', 'body', 'language',
                'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object',
-               'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'item_id',
+               'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid',
                'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network',
                'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'owner-network',
                'causer-id', 'causer-link', 'causer-name', 'causer-avatar', 'causer-contact-type',
@@ -212,7 +212,8 @@ class Item
                DBA::close($items);
 
                foreach ($notify_items as $notify_item) {
-                       Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, $notify_item);
+                       $post = Post::selectFirst(['uri-id', 'uid'], ['id' => $notify_item]);
+                       Worker::add(PRIORITY_HIGH, "Notifier", Delivery::POST, (int)$post['uri-id'], (int)$post['uid']);
                }
 
                return $rows;
@@ -354,7 +355,7 @@ class Item
 
                        // send the notification upstream/downstream
                        if ($priority) {
-                               Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", Delivery::DELETION, intval($item['id']));
+                               Worker::add(['priority' => $priority, 'dont_fork' => true], "Notifier", Delivery::DELETION, (int)$item['uri-id'], (int)$item['uid']);
                        }
                } elseif ($item['uid'] != 0) {
                        Post\User::update($item['uri-id'], $item['uid'], ['hidden' => true]);
@@ -959,6 +960,10 @@ class Item
                        $item['deny_gid']
                );
 
+               if (!empty($item['extid'])) {
+                       $item['external-id'] = ItemURI::getIdByURI($item['extid']);
+               }
+
                if ($item['verb'] == Activity::ANNOUNCE) {
                        self::setOwnerforResharedItem($item);
                }
@@ -1138,7 +1143,7 @@ class Item
                }
 
                if ($transmit) {
-                       Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $notify_type, $current_post);
+                       Worker::add(['priority' => $priority, 'dont_fork' => true], 'Notifier', $notify_type, (int)$item['uri-id'], (int)$item['uid']);
                }
 
                return $current_post;
@@ -1862,7 +1867,7 @@ class Item
                        'owner-id' => $owner_id, 'private' => $private, 'psid' => $psid];
                self::update($fields, ['id' => $item_id]);
 
-               Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'Notifier', Delivery::POST, $item_id);
+               Worker::add(['priority' => PRIORITY_HIGH, 'dont_fork' => true], 'Notifier', Delivery::POST, (int)$item['uri-id'], (int)$item['uid']);
 
                self::performActivity($item_id, 'announce', $uid);