X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDFRN.php;h=1bb7bf3ff14dd2938339ed92c3f0d3bfb8e5aed2;hb=88f21c5892f26cfa18c59c7cba22005b1c3bc55c;hp=e29cfcc5ab38c7cd29989179c53da31cc0e0489e;hpb=d75cd8a00a88a52e6d7bf67c91ba464c81c644c1;p=friendica.git diff --git a/src/Protocol/DFRN.php b/src/Protocol/DFRN.php index e29cfcc5ab..1bb7bf3ff1 100644 --- a/src/Protocol/DFRN.php +++ b/src/Protocol/DFRN.php @@ -1,6 +1,6 @@ set('system', 'site_pubkey', $res['pubkey']); } - $profilephotos = Photo::selectToArray(['resource-id' , 'scale'], ['profile' => true, 'uid' => $uid], ['order' => ['scale']]); + $profilephotos = Photo::selectToArray(['resource-id', 'scale', 'type'], ['profile' => true, 'uid' => $uid], ['order' => ['scale']]); $photos = []; $ext = Images::supportedTypes(); foreach ($profilephotos as $p) { - $photos[$p['scale']] = DI::baseUrl().'/photo/'.$p['resource-id'].'-'.$p['scale'].'.'.$ext[$p['type']]; + $photos[$p['scale']] = DI::baseUrl() . '/photo/' . $p['resource-id'] . '-' . $p['scale'] . '.' . $ext[$p['type']]; } - $doc = new DOMDocument('1.0', 'utf-8'); $doc->formatOutput = true; @@ -775,6 +774,7 @@ class DFRN } $body = Post\Media::addAttachmentsToBody($item['uri-id'], DI::contentItem()->addSharedPost($item)); + $body = Post\Media::addHTMLAttachmentToBody($item['uri-id'], $body); if ($item['private'] == Item::PRIVATE) { $body = Item::fixPrivatePhotos($body, $owner['uid'], $item, $cid); @@ -1015,6 +1015,10 @@ class DFRN $xml = $postResult->getBody(); $curl_stat = $postResult->getReturnCode(); + if (!empty($contact['gsid']) && ($postResult->isTimeout() || empty($curl_stat))) { + GServer::setFailureById($contact['gsid']); + } + if (empty($curl_stat) || empty($xml)) { Logger::notice('Empty answer from ' . $contact['id'] . ' - ' . $dest_url); return -9; // timed out @@ -1036,6 +1040,10 @@ class DFRN return -23; } + if (!empty($contact['gsid'])) { + GServer::setReachableById($contact['gsid'], Protocol::DFRN); + } + if (!empty($res->message)) { Logger::info('Transmit to ' . $dest_url . ' returned status '.$res->status.' - '.$res->message); } @@ -2072,6 +2080,7 @@ class DFRN // This is my contact on another system, but it's really me. // Turn this into a wall post. $notify = Item::isRemoteSelf($importer, $item); + $item['wall'] = (bool)$notify; $posted_id = Item::insert($item, $notify);