]> git.mxchange.org Git - friendica.git/blobdiff - src/Protocol/DFRN.php
Merge pull request #5848 from nupplaphil/friendica-5847
[friendica.git] / src / Protocol / DFRN.php
index b207c3ca87cde7b4be9d705e936150c26a2c4cac..4d61f9aee00bb36f2a27225070e04d17c7f7b333 100644 (file)
@@ -1164,12 +1164,12 @@ class DFRN
         * @return int Deliver status. Negative values mean an error.
         * @todo Add array type-hint for $owner, $contact
         */
-       public static function deliver($owner, $contact, $atom, $dissolve = false)
+       public static function deliver($owner, $contact, $atom, $dissolve = false, $legacy_transport = false)
        {
                $a = get_app();
 
                // At first try the Diaspora transport layer
-               if (!$dissolve) {
+               if (!$dissolve && !$legacy_transport) {
                        $ret = self::transmit($owner, $contact, $atom);
                        if ($ret >= 200) {
                                logger('Delivery via Diaspora transport layer was successful with status ' . $ret);
@@ -2349,6 +2349,12 @@ class DFRN
                                if (Item::exists($condition)) {
                                        return false;
                                }
+
+                               // The owner of an activity must be the author
+                               $item["owner-name"] = $item["author-name"];
+                               $item["owner-link"] = $item["author-link"];
+                               $item["owner-avatar"] = $item["author-avatar"];
+                               $item["owner-id"] = $item["author-id"];
                        } else {
                                $is_like = false;
                        }