}
$contact = $r[0];
- include_once 'include/security.php';
$set = PermissionSet::get($owner_id, $contact['id']);
XML::addElement($doc, $author, "dfrn:handle", $owner["addr"], $attributes);
$attributes = ["rel" => "photo", "type" => "image/jpeg",
- "media:width" => 175, "media:height" => 175, "href" => $owner['photo']];
+ "media:width" => 300, "media:height" => 300, "href" => $owner['photo']];
if (!$public || !$hidewall) {
$attributes["dfrn:updated"] = $picdate;
// At first try the Diaspora transport layer
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;
+ $curlResult = self::transmit($owner, $contact, $atom);
+ if ($curlResult >= 200) {
+ logger('Delivery via Diaspora transport layer was successful with status ' . $curlResult);
+ return $curlResult;
}
}
logger('dfrn_deliver: ' . $url);
- $ret = Network::curl($url);
+ $curlResult = Network::curl($url);
- if (!empty($ret["errno"]) && ($ret['errno'] == CURLE_OPERATION_TIMEDOUT)) {
+ if ($curlResult->isTimeout()) {
Contact::markForArchival($contact);
return -2; // timed out
}
- $xml = $ret['body'];
+ $xml = $curlResult->getBody();
- $curl_stat = Network::getCurl()->getCode();
+ $curl_stat = $curlResult->getReturnCode();
if (empty($curl_stat)) {
Contact::markForArchival($contact);
return -3; // timed out
logger('dfrn_deliver: ' . "SENDING: " . print_r($postvars, true), LOGGER_DATA);
- $xml = Network::post($contact['notify'], $postvars);
+ $postResult = Network::post($contact['notify'], $postvars);
+
+ $xml = $postResult->getBody();
logger('dfrn_deliver: ' . "RECEIVED: " . $xml, LOGGER_DATA);
- $curl_stat = Network::getCurl()->getCode();
+ $curl_stat = $postResult->getReturnCode();
if (empty($curl_stat) || empty($xml)) {
Contact::markForArchival($contact);
return -9; // timed out
}
- if (($curl_stat == 503) && stristr(Network::getCurl()->getHeaders(), 'retry-after')) {
+ if (($curl_stat == 503) && stristr($postResult->getHeader(), 'retry-after')) {
Contact::markForArchival($contact);
return -10;
}
$content_type = ($public_batch ? "application/magic-envelope+xml" : "application/json");
- $xml = Network::post($dest_url, $envelope, ["Content-Type: ".$content_type]);
+ $postResult = Network::post($dest_url, $envelope, ["Content-Type: ".$content_type]);
+ $xml = $postResult->getBody();
- $curl_stat = Network::getCurl()->getCode();
+ $curl_stat = $postResult->getReturnCode();
if (empty($curl_stat) || empty($xml)) {
logger('Empty answer from ' . $contact['id'] . ' - ' . $dest_url);
Contact::markForArchival($contact);
return -9; // timed out
}
- if (($curl_stat == 503) && (stristr(Network::getCurl()->getHeaders(), 'retry-after'))) {
+ if (($curl_stat == 503) && (stristr($postResult->getHeader(), 'retry-after'))) {
Contact::markForArchival($contact);
return -10;
}
logger('auto_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
$dest = (($url) ? '&destination_url=' . $url : '');
- goaway($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
+ System::externalRedirect($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest);
}