if (DI::pConfig()->get($post['uid'], 'pumpio', 'import')) {
// Don't fork if it isn't a reply to a pump.io post
- if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::PUMPIO])) {
+ if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::PUMPIO])) {
Logger::log('No pump.io parent found for item ' . $post['id']);
$b['execute'] = false;
return;
}
$condition = ['verb' => Activity::LIKE, 'uid' => $uid, 'contact-id' => $contactid, 'thr-parent' => $orig_post['uri']];
- if (Item::exists($condition)) {
+ if (Post::exists($condition)) {
Logger::log("pumpio_dolike: found existing like. User ".$own_id." ".$uid." Contact: ".$contactid." Url ".$orig_post['uri']);
return;
}
{
// Two queries for speed issues
$condition = ['uri' => $post->object->id, 'uid' => $uid];
- if (Item::exists($condition)) {
+ if (Post::exists($condition)) {
Item::markForDeletion($condition);
return true;
}
$condition = ['extid' => $post->object->id, 'uid' => $uid];
- if (Item::exists($condition)) {
+ if (Post::exists($condition)) {
Item::markForDeletion($condition);
return true;
}
if ($post->verb != "update") {
// Two queries for speed issues
- if (Item::exists(['uri' => $post->object->id, 'uid' => $uid])) {
+ if (Post::exists(['uri' => $post->object->id, 'uid' => $uid])) {
return false;
}
- if (Item::exists(['extid' => $post->object->id, 'uid' => $uid])) {
+ if (Post::exists(['extid' => $post->object->id, 'uid' => $uid])) {
return false;
}
}
$self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
intval($uid));
- $lastitems = q("SELECT `uri` FROM `thread`
- INNER JOIN `item` ON `item`.`id` = `thread`.`iid`
- WHERE `thread`.`network` = '%s' AND `thread`.`uid` = %d AND `item`.`extid` != ''
- ORDER BY `thread`.`commented` DESC LIMIT 10",
+ $lastitems = q("SELECT `uri` FROM `post-thread-user`
+ INNER JOIN `post-view` ON `post-view`.`id` = `post-thread-user`.`id`
+ WHERE `post-thread-user`.`network` = '%s' AND `post-thread-user`.`uid` = %d AND `post-view`.`extid` != ''
+ ORDER BY `post-thread-user`.`commented` DESC LIMIT 10",
DBA::escape(Protocol::PUMPIO),
intval($uid)
);
}
// Checking if the comment already exists - Two queries for speed issues
- if (Item::exists(['uri' => $item->id, 'uid' => $uid])) {
+ if (Post::exists(['uri' => $item->id, 'uid' => $uid])) {
continue;
}
- if (Item::exists(['extid' => $item->id, 'uid' => $uid])) {
+ if (Post::exists(['extid' => $item->id, 'uid' => $uid])) {
continue;
}