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;
}
}
}
// 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;
}
if (DI::pConfig()->get($post['uid'], 'statusnet', 'import')) {
// Don't fork if it isn't a reply to a GNU Social post
- if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::STATUSNET])) {
+ if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::STATUSNET])) {
Logger::log('No GNU Social parent found for item ' . $post['id']);
$b['execute'] = false;
return;
$postarray['uri'] = $hostname . "::" . $content->id;
- if (Item::exists(['extid' => $postarray['uri'], 'uid' => $uid])) {
+ if (Post::exists(['extid' => $postarray['uri'], 'uid' => $uid])) {
return [];
}
if (DI::pConfig()->get($post['uid'], 'twitter', 'import')) {
// Don't fork if it isn't a reply to a twitter post
- if (($post['parent'] != $post['id']) && !Item::exists(['id' => $post['parent'], 'network' => Protocol::TWITTER])) {
+ if (($post['parent'] != $post['id']) && !Post::exists(['id' => $post['parent'], 'network' => Protocol::TWITTER])) {
Logger::notice('No twitter parent found', ['item' => $post['id']]);
$b['execute'] = false;
return;
Logger::notice('Start deleting expired posts');
- $r = Item::select(['id', 'guid'], ['deleted' => true, 'network' => Protocol::TWITTER]);
- while ($row = DBA::fetch($r)) {
+ $r = Post::select(['id', 'guid'], ['deleted' => true, 'network' => Protocol::TWITTER]);
+ while ($row = Post::fetch($r)) {
Logger::info('[twitter] Delete expired item', ['id' => $row['id'], 'guid' => $row['guid'], 'callstack' => \Friendica\Core\System::callstack()]);
DBA::delete('item', ['id' => $row['id']]);
}
}
// Don't import our own comments
- if (Item::exists(['extid' => $postarray['uri'], 'uid' => $uid])) {
+ if (Post::exists(['extid' => $postarray['uri'], 'uid' => $uid])) {
Logger::info('Item found', ['extid' => $postarray['uri']]);
return [];
}
break;
}
- if (Item::exists(['uri' => 'twitter::' . $post->id_str, 'uid' => $uid])) {
+ if (Post::exists(['uri' => 'twitter::' . $post->id_str, 'uid' => $uid])) {
break;
}