X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDFRN.php;h=1ab4d8f9e4959592cf887e9f09f651989de53455;hb=acd1caa1144f558002214d5991f551f232482200;hp=759f7f5f28b03c7596e7b42f607f88bfad67a1f5;hpb=601851f3d0b5439f75c6e984733e850c7beed40c;p=friendica.git diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index 759f7f5f28..1ab4d8f9e4 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -81,7 +81,8 @@ class DFRN return []; } - $user['importer_uid'] = $user['uid']; + $user['importer_uid'] = $user['uid']; + $user['uprvkey'] = $user['prvkey']; } else { $user = ['importer_uid' => 0, 'uprvkey' => '', 'timezone' => 'UTC', 'nickname' => '', 'sprvkey' => '', 'spubkey' => '', @@ -1163,15 +1164,17 @@ 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 - $ret = self::transmit($owner, $contact, $atom); - if ($ret >= 200) { - logger('Delivery via Diaspora transport layer was successful with status ' . $ret); - return $ret; + if (!$dissolve && !$legacy_transport) { + $ret = self::transmit($owner, $contact, $atom); + if ($ret >= 200) { + logger('Delivery via Diaspora transport layer was successful with status ' . $ret); + return $ret; + } } $idtosend = $orig_id = (($contact['dfrn-id']) ? $contact['dfrn-id'] : $contact['issued-id']); @@ -2407,8 +2410,11 @@ class DFRN break; case "enclosure": $enclosure = $href; - if (strlen($item["attach"])) { + + if (!empty($item["attach"])) { $item["attach"] .= ","; + } else { + $item["attach"] = ""; } $item["attach"] .= '[attach]href="' . $href . '" length="' . $length . '" type="' . $type . '" title="' . $title . '"[/attach]';