$likedata['wall'] = 0;
$likedata['network'] = Protocol::PUMPIO;
$likedata['uri'] = Item::newURI($uid);
- $likedata['parent-uri'] = $orig_post["uri"];
+ $likedata['thr-parent'] = $orig_post['uri'];
$likedata['contact-id'] = $contactid;
$likedata['app'] = $post->generator->displayName;
$likedata['author-name'] = $post->actor->displayName;
$contact_id = $self[0]['id'];
}
- $postarray['parent-uri'] = $post->object->id;
+ $postarray['thr-parent'] = $post->object->id;
if (!$public) {
$postarray['private'] = 1;
$reply->url = $post->object->inReplyTo->url;
pumpio_dopost($a, $client, $uid, $self, $reply, $own_id, false);
- $postarray['parent-uri'] = $post->object->inReplyTo->id;
+ $postarray['thr-parent'] = $post->object->inReplyTo->id;
}
// When there is no content there is no need to continue
}
if (($post->object->objectType == "comment") && $threadcompletion) {
- pumpio_fetchallcomments($a, $uid, $postarray['parent-uri']);
+ pumpio_fetchallcomments($a, $uid, $postarray['thr-parent']);
}
return $top_item;
$contactid = 0;
if (!empty($content->in_reply_to_status_id)) {
+ $thr_parent = $hostname . "::" . $content->in_reply_to_status_id;
- $parent = $hostname . "::" . $content->in_reply_to_status_id;
-
- $fields = ['uri', 'parent-uri', 'parent'];
- $item = Item::selectFirst($fields, ['uri' => $parent, 'uid' => $uid]);
-
- if (!DBA::isResult($item)) {
- $item = Item::selectFirst($fields, ['extid' => $parent, 'uid' => $uid]);
- }
-
- if (DBA::isResult($item)) {
- $postarray['thr-parent'] = $item['uri'];
- $postarray['parent-uri'] = $item['parent-uri'];
- $postarray['parent'] = $item['parent'];
+ if (
+ Item::exists(['uri' => $thr_parent, 'uid' => $uid])
+ || Item::exists(['extid' => $thr_parent, 'uid' => $uid])
+ ) {
+ $postarray['thr-parent'] = $thr_parent;
$postarray['object-type'] = Activity\ObjectType::COMMENT;
} else {
- $postarray['thr-parent'] = $postarray['uri'];
- $postarray['parent-uri'] = $postarray['uri'];
$postarray['object-type'] = Activity\ObjectType::NOTE;
}
// Don't create accounts of people who just comment something
$create_user = false;
} else {
- $postarray['parent-uri'] = $postarray['uri'];
$postarray['object-type'] = Activity\ObjectType::NOTE;
}
$contactid = 0;
if ($post->in_reply_to_status_id_str != "") {
- $parent = "twitter::" . $post->in_reply_to_status_id_str;
+ $thr_parent = "twitter::" . $post->in_reply_to_status_id_str;
- $fields = ['uri', 'parent-uri', 'parent'];
- $parent_item = Item::selectFirst($fields, ['uri' => $parent, 'uid' => $uid]);
- if (!DBA::isResult($parent_item)) {
- $parent_item = Item::selectFirst($fields, ['extid' => $parent, 'uid' => $uid]);
- }
-
- if (DBA::isResult($parent_item)) {
- $postarray['thr-parent'] = $parent_item['uri'];
- $postarray['parent-uri'] = $parent_item['parent-uri'];
- $postarray['parent'] = $parent_item['parent'];
+ if (
+ Item::exists(['uri' => $thr_parent, 'uid' => $uid])
+ || Item::exists(['extid' => $thr_parent, 'uid' => $uid])
+ ) {
+ $postarray['thr-parent'] = $thr_parent;
$postarray['object-type'] = Activity\ObjectType::COMMENT;
} else {
- $postarray['thr-parent'] = $postarray['uri'];
- $postarray['parent-uri'] = $postarray['uri'];
$postarray['object-type'] = Activity\ObjectType::NOTE;
}
// Don't create accounts of people who just comment something
$create_user = false;
} else {
- $postarray['parent-uri'] = $postarray['uri'];
$postarray['object-type'] = Activity\ObjectType::NOTE;
}
$postarray['verb'] = Activity::ANNOUNCE;
$postarray['gravity'] = GRAVITY_ACTIVITY;
$postarray['object-type'] = Activity\ObjectType::NOTE;
-
- $postarray['thr-parent'] = $retweet['uri'];
- $postarray['parent-uri'] = $retweet['uri'];
} else {
$retweet['source'] = $postarray['source'];
$retweet['private'] = $postarray['private'];
$notify = false;
- if (($postarray['uri'] == $postarray['parent-uri']) && ($postarray['author-link'] == $postarray['owner-link'])) {
+ if (($postarray['uri'] == $postarray['thr-parent']) && ($postarray['author-link'] == $postarray['owner-link'])) {
$contact = DBA::selectFirst('contact', [], ['id' => $postarray['contact-id'], 'self' => false]);
if (DBA::isResult($contact)) {
$notify = Item::isRemoteSelf($contact, $postarray);