X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FDiaspora.php;h=c25eb9689805042d5eb215f72c01beb1b1d2f15c;hb=dfbac99aa6949fe09a1447abcdbdbcec19d89b1a;hp=8decec0d024feeb5833f56dca94fe6363b679898;hpb=7f3fb34c24e30b79d8c25f63dbb2c3c3da79e599;p=friendica.git diff --git a/src/Protocol/Diaspora.php b/src/Protocol/Diaspora.php index 8decec0d02..c25eb96898 100644 --- a/src/Protocol/Diaspora.php +++ b/src/Protocol/Diaspora.php @@ -1050,7 +1050,7 @@ class Diaspora return false; } - $contact = dba::selectFirst('contact', [], ['id' => $cid]); + $contact = DBA::selectFirst('contact', [], ['id' => $cid]); if (!DBA::isResult($contact)) { // This here shouldn't happen at all logger("Haven't found a contact for user " . $uid . " and handle " . $handle, LOGGER_DEBUG); @@ -1079,7 +1079,7 @@ class Diaspora // It is deactivated by now, due to side effects. See issue https://github.com/friendica/friendica/pull/4033 // It is not removed by now. Possibly the code is needed? //if (!$is_comment && $contact["rel"] == Contact::FOLLOWER && in_array($importer["page-flags"], array(Contact::PAGE_FREELOVE))) { - // dba::update( + // DBA::update( // 'contact', // array('rel' => Contact::FRIEND, 'writable' => true), // array('id' => $contact["id"], 'uid' => $contact["uid"]) @@ -1821,10 +1821,10 @@ class Diaspora "to_name" => $importer["username"], "to_email" => $importer["email"], "uid" =>$importer["uid"], - "item" => ["subject" => $subject, "body" => $body], + "item" => ["id" => $conversation["id"], "title" => $subject, "subject" => $subject, "body" => $body], "source_name" => $person["name"], "source_link" => $person["url"], - "source_photo" => $person["thumb"], + "source_photo" => $person["photo"], "verb" => ACTIVITY_POST, "otype" => "mail"] ); @@ -2425,10 +2425,11 @@ class Diaspora Contact::updateAvatar($contact_record["photo"], $importer["uid"], $contact_record["id"]); - // technically they are sharing with us (Contact::SHARING), - // but if our page-type is PAGE_COMMUNITY or PAGE_SOAPBOX - // we are going to change the relationship and make them a follower. - + /* + * technically they are sharing with us (Contact::SHARING), + * but if our page-type is Profile::PAGE_COMMUNITY or Profile::PAGE_SOAPBOX + * we are going to change the relationship and make them a follower. + */ if (($importer["page-flags"] == Contact::PAGE_FREELOVE) && $sharing && $following) { $new_relation = Contact::FRIEND; } elseif (($importer["page-flags"] == Contact::PAGE_FREELOVE) && $sharing) { @@ -2755,7 +2756,7 @@ class Diaspora * * @return int The message id of the newly created item */ - private static function receiveStatusMessage(array $importer, $data, $xml) + private static function receiveStatusMessage(array $importer, SimpleXMLElement $data, $xml) { $author = notags(unxmlify($data->author)); $guid = notags(unxmlify($data->guid)); @@ -3075,7 +3076,7 @@ class Diaspora logger("transmit: ".$logid."-".$guid." to ".$dest_url." returns: ".$return_code); if (!$return_code || (($return_code == 503) && (stristr($a->get_curl_headers(), "retry-after")))) { - if (!$no_queue && ($contact['contact-type'] != Contact::ACCOUNT_TYPE_RELAY)) { + if (!$no_queue && !empty($contact['contact-type']) && ($contact['contact-type'] != Contact::ACCOUNT_TYPE_RELAY)) { logger("queue message"); // queue message for redelivery Queue::add($contact["id"], Protocol::DIASPORA, $envelope, $public_batch, $guid);