]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #7858 from annando/diaspora-date
authorHypolite Petovan <hypolite@mrpetovan.com>
Fri, 22 Nov 2019 20:36:27 +0000 (15:36 -0500)
committerGitHub <noreply@github.com>
Fri, 22 Nov 2019 20:36:27 +0000 (15:36 -0500)
Don't use the creation date when transmitting to Diaspora

1  2 
src/Protocol/Diaspora.php

index 7c583dc280947ad6cafa5ea8fa7b6e46f8e6f480,d780391e70089b3f22b6509840f19ea2536d6354..f341f217c40ec47f2dde38d231f97f70a4f4bc57
@@@ -3419,7 -3419,7 +3419,7 @@@ class Diaspor
                        $condition = ['guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
                        $item = Item::selectFirst(['contact-id'], $condition);
                        if (DBA::isResult($item)) {
 -                              $ret= [];
 +                              $ret = [];
                                $ret["root_handle"] = self::handleFromContact($item["contact-id"]);
                                $ret["root_guid"] = $guid;
                                return $ret;
                        $profile = $matches[1];
                }
  
 -              $ret= [];
 +              $ret = [];
  
 -              if ($profile != "") {
 -                      if (Contact::getIdForURL($profile)) {
 -                              $author = Contact::getDetailsByURL($profile);
 -                              $ret["root_handle"] = $author['addr'];
 +              if (!empty($profile) && ($cid = Contact::getIdForURL($profile))) {
 +                      $contact = DBA::selectFirst('contact', ['addr'], ['id' => $cid]);
 +                      if (!empty($contact['addr'])) {
 +                              $ret['root_handle'] = $contact['addr'];
                        }
                }
  
                $myaddr = self::myHandle($owner);
  
                $public = ($item["private"] ? "false" : "true");
-               $created = DateTimeFormat::utc($item["created"], DateTimeFormat::ATOM);
+               $created = DateTimeFormat::utc($item['received'], DateTimeFormat::ATOM);
                $edited = DateTimeFormat::utc($item["edited"] ?? $item["created"], DateTimeFormat::ATOM);
  
                // Detect a share element and do a reshare