]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
The "thread" table isn't used anymore
[friendica.git] / src / Protocol / DFRN.php
index 6cc2de44f5d76ae050dadc9fd29af088ff8debf9..7cb9db1a136d2d4834bc8ad8ef24ea63011f75cf 100644 (file)
@@ -37,8 +37,7 @@ use Friendica\Model\FContact;
 use Friendica\Model\Item;
 use Friendica\Model\ItemURI;
 use Friendica\Model\Mail;
-use Friendica\Model\Notify;
-use Friendica\Model\Notify\Type;
+use Friendica\Model\Notification;
 use Friendica\Model\PermissionSet;
 use Friendica\Model\Post;
 use Friendica\Model\Post\Category;
@@ -311,23 +310,26 @@ class DFRN
        }
 
        /**
-        * Generate an atom entry for a given item id
+        * Generate an atom entry for a given uri id and user
         *
-        * @param int     $item_id      The item id
+        * @param int     $uri_id       The uri id
+        * @param int     $uid          The user id
         * @param boolean $conversation Show the conversation. If false show the single post.
         *
         * @return string DFRN feed entry
         * @throws \Friendica\Network\HTTPException\InternalServerErrorException
         * @throws \ImagickException
         */
-       public static function itemFeed($item_id, $conversation = false)
+       public static function itemFeed(int $uri_id, int $uid, bool $conversation = false)
        {
                if ($conversation) {
-                       $condition = ['parent' => $item_id];
+                       $condition = ['parent-uri-id' => $uri_id];
                } else {
-                       $condition = ['id' => $item_id];
+                       $condition = ['uri-id' => $uri_id];
                }
 
+               $condition['uid'] = $uid;
+
                $items = Post::selectToArray(Item::DELIVER_FIELDLIST, $condition);
                if (!DBA::isResult($items)) {
                        return '';
@@ -1963,8 +1965,8 @@ class DFRN
                                // send a notification
                                notification(
                                        [
-                                       "type"     => Type::POKE,
-                                       "otype"    => Notify\ObjectType::PERSON,
+                                       "type"     => Notification\Type::POKE,
+                                       "otype"    => Notification\ObjectType::PERSON,
                                        "activity" => $verb,
                                        "verb"     => $item["verb"],
                                        "uid"      => $importer["importer_uid"],