}
if (Config::get("system", "relay_directly", false)) {
+ // We distribute our stuff based on the parent to ensure that the thread will be complete
+ $parent = dba::selectFirst('item', ['parent'], ['id' => $item_id]);
+ if (!DBM::is_result($parent)) {
+ return;
+ }
+
// Servers that want to get all content
$servers = dba::select('gserver', ['url'], ['relay-subscribe' => true, 'relay-scope' => 'all']);
while ($server = dba::fetch($servers)) {
}
// All tags of the current post
- $condition = ['otype' => TERM_OBJ_POST, 'type' => TERM_HASHTAG, 'oid' => $item_id];
+ $condition = ['otype' => TERM_OBJ_POST, 'type' => TERM_HASHTAG, 'oid' => $parent['parent']];
$tags = dba::select('term', ['term'], $condition);
$taglist = [];
while ($tag = dba::fetch($tags)) {
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;
}