logger('Contacts are updated.');
// update items
- /// @todo This is an extreme performance killer
- $fields = [
- 'owner-link' => [$contact["url"], $data["url"]],
- 'author-link' => [$contact["url"], $data["url"]],
- ];
- foreach ($fields as $n => $f) {
- $r = q(
- "SELECT `id` FROM `item` WHERE `%s` = '%s' AND `uid` = %d LIMIT 1",
- $n,
- dbesc($f[0]),
- intval($importer["uid"])
- );
-
- if (DBM::is_result($r)) {
- $x = q(
- "UPDATE `item` SET `%s` = '%s' WHERE `%s` = '%s' AND `uid` = %d",
- $n,
- dbesc($f[1]),
- $n,
- dbesc($f[0]),
- intval($importer["uid"])
- );
-
- if ($x === false) {
- return false;
- }
- }
- }
+ // This is an extreme performance killer
+ Item::update(['owner-link' => $data["url"]], ['owner-link' => $contact["url"], 'uid' => $importer["uid"]]);
+ Item::update(['author-link' => $data["url"]], ['author-link' => $contact["url"], 'uid' => $importer["uid"]]);
logger('Items are updated.');
case "StatusMessage":
return self::itemRetraction($importer, $contact, $data);
- case "Contact":
- case "Person":
- /// @todo What should we do with an "unshare"?
- // Removing the contact isn't correct since we still can read the public items
- Contact::remove($contact["id"]);
- return true;
+ case "PollParticipation":
+ case "Photo":
+ // Currently unsupported
+ break;
default:
logger("Unknown target type ".$target_type);
$ret["root_guid"] = $guid;
return $ret;
}
+ } elseif (($guid == "") && $complete) {
+ return false;
}
+ $ret["root_guid"] = $guid;
+
$profile = "";
preg_match("/profile='(.*?)'/ism", $attributes, $matches);
if ($matches[1] != "") {
}
}
- if (!empty($guid)) {
- $ret["root_guid"] = $guid;
- }
-
if (empty($ret) && !$complete) {
return true;
}