use Friendica\Database\DBStructure;
use Friendica\DI;
use Friendica\Model\Item;
+use Friendica\Model\Post;
use Friendica\Model\Tag;
use Friendica\Module\Security\Login;
use Friendica\Network\HTTPException;
$condition = ["`guid` = ? AND (`uid` = ? OR `uid` = 0)", $args['guid'], local_user()];
$params = ['order' => ['uid' => true]];
- $item = Item::selectFirstForUser(local_user(), [], $condition, $params);
+ $item = Post::selectFirstForUser(local_user(), [], $condition, $params);
if (!DBA::isResult($item)) {
throw new HTTPException\NotFoundException(DI::l10n()->t('Unknown post with guid: %s', $args['guid']));
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
+use Friendica\Model\Post;
use Friendica\Protocol\Activity;
function mailstream_install() {
$parent = $item['thr-parent'];
// Don't look more than 100 levels deep for a subject, in case of loops
for ($i = 0; ($i < 100) && $parent; $i++) {
- $parent_item = Item::selectFirst(['thr-parent', 'title'], ['uri' => $parent]);
+ $parent_item = Post::selectFirst(['thr-parent', 'title'], ['uri' => $parent]);
if (!DBA::isResult($parent_item)) {
break;
}
if (!$ms_item_id['message-id'] || !strlen($ms_item_id['message-id'])) {
Logger::info('mailstream_cron: Item ' . $ms_item_id['id'] . ' URI ' . $ms_item_id['uri'] . ' has no message-id');
}
- $item = Item::selectFirst([], ['id' => $ms_item_id['id']]);
+ $item = Post::selectFirst([], ['id' => $ms_item_id['id']]);
$users = q("SELECT * FROM `user` WHERE `uid` = %d", intval($item['uid']));
$user = $users[0];
if ($user && $item) {
use Friendica\Model\Contact;
use Friendica\Model\Group;
use Friendica\Model\Item;
+use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Protocol\Activity;
use Friendica\Protocol\ActivityNamespace;
if ($b['parent'] != $b['id']) {
// Looking if its a reply to a pumpio post
$condition = ['id' => $b['parent'], 'network' => Protocol::PUMPIO];
- $orig_post = Item::selectFirst([], $condition);
+ $orig_post = Post::selectFirst([], $condition);
if (!DBA::isResult($orig_post)) {
Logger::log("pumpio_send: no pumpio post ".$b["parent"]);
$hostname = DI::pConfig()->get($uid, 'pumpio', 'host');
$username = DI::pConfig()->get($uid, "pumpio", "user");
- $orig_post = Item::selectFirst([], ['uri' => $uri, 'uid' => $uid]);
+ $orig_post = Post::selectFirst([], ['uri' => $uri, 'uid' => $uid]);
if (!DBA::isResult($orig_post)) {
return;
{
// Searching for the unliked post
// Two queries for speed issues
- $orig_post = Item::selectFirst([], ['uri' => $post->object->id, 'uid' => $uid]);
+ $orig_post = Post::selectFirst([], ['uri' => $post->object->id, 'uid' => $uid]);
if (!DBA::isResult($orig_post)) {
- $orig_post = Item::selectFirst([], ['extid' => $post->object->id, 'uid' => $uid]);
+ $orig_post = Post::selectFirst([], ['extid' => $post->object->id, 'uid' => $uid]);
if (!DBA::isResult($orig_post)) {
return;
}
// Searching for the liked post
// Two queries for speed issues
- $orig_post = Item::selectFirst([], ['uri' => $post->object->id, 'uid' => $uid]);
+ $orig_post = Post::selectFirst([], ['uri' => $post->object->id, 'uid' => $uid]);
if (!DBA::isResult($orig_post)) {
- $orig_post = Item::selectFirst([], ['extid' => $post->object->id, 'uid' => $uid]);
+ $orig_post = Post::selectFirst([], ['extid' => $post->object->id, 'uid' => $uid]);
if (!DBA::isResult($orig_post)) {
return;
}
// Fetching the original post
$condition = ["`uri` = ? AND `uid` = ? AND `extid` != ''", $id, $uid];
- $original = Item::selectFirst(['extid'], $condition);
+ $original = Post::selectFirst(['extid'], $condition);
if (!DBA::isResult($original)) {
return false;
}
use Friendica\Model\Item;
use Friendica\Model\ItemContent;
use Friendica\Model\Photo;
+use Friendica\Model\Post;
use Friendica\Model\User;
use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
}
$condition = ['uri' => $b["thr-parent"], 'uid' => $b["uid"]];
- $orig_post = Item::selectFirst(['author-link', 'uri'], $condition);
+ $orig_post = Post::selectFirst(['author-link', 'uri'], $condition);
if (!DBA::isResult($orig_post)) {
Logger::log("statusnet_post_hook: no parent found " . $b["thr-parent"]);
return;
$item["plink"] = DI::baseUrl()->get() . "/display/" . $item["guid"];
$condition = ['uri' => $item["thr-parent"], 'uid' => local_user()];
- $orig_post = Item::selectFirst(['author-link', 'uri'], $condition);
+ $orig_post = Post::selectFirst(['author-link', 'uri'], $condition);
if (DBA::isResult($orig_post)) {
$nick = preg_replace("=https?://(.*)/(.*)=ism", "$2", $orig_post["author-link"]);
if (!empty($content->in_reply_to_status_id)) {
$thr_parent = $hostname . "::" . $content->in_reply_to_status_id;
- $item = Item::selectFirst(['uri'], ['uri' => $thr_parent, 'uid' => $uid]);
+ $item = Post::selectFirst(['uri'], ['uri' => $thr_parent, 'uid' => $uid]);
if (!DBA::isResult($item)) {
- $item = Item::selectFirst(['uri'], ['extid' => $thr_parent, 'uid' => $uid]);
+ $item = Post::selectFirst(['uri'], ['extid' => $thr_parent, 'uid' => $uid]);
}
if (DBA::isResult($item)) {
}
$condition = ['uri' => $b["thr-parent"], 'uid' => $b["uid"]];
- $thr_parent = Item::selectFirst(['uri', 'extid', 'author-link', 'author-nick', 'author-network'], $condition);
+ $thr_parent = Post::selectFirst(['uri', 'extid', 'author-link', 'author-nick', 'author-network'], $condition);
if (!DBA::isResult($thr_parent)) {
Logger::warning('No parent found', ['thr-parent' => $b["thr-parent"]]);
return;
$item["plink"] = DI::baseUrl()->get() . "/display/" . $item["guid"];
$condition = ['uri' => $item["thr-parent"], 'uid' => local_user()];
- $orig_post = Item::selectFirst(['author-link'], $condition);
+ $orig_post = Post::selectFirst(['author-link'], $condition);
if (DBA::isResult($orig_post)) {
$nicknameplain = preg_replace("=https?://twitter.com/(.*)=ism", "$1", $orig_post["author-link"]);
$nickname = "@[url=" . $orig_post["author-link"] . "]" . $nicknameplain . "[/url]";
if ($post->in_reply_to_status_id_str != "") {
$thr_parent = "twitter::" . $post->in_reply_to_status_id_str;
- $item = Item::selectFirst(['uri'], ['uri' => $thr_parent, 'uid' => $uid]);
+ $item = Post::selectFirst(['uri'], ['uri' => $thr_parent, 'uid' => $uid]);
if (!DBA::isResult($item)) {
- $item = Item::selectFirst(['uri'], ['extid' => $thr_parent, 'uid' => $uid]);
+ $item = Post::selectFirst(['uri'], ['extid' => $thr_parent, 'uid' => $uid]);
}
if (DBA::isResult($item)) {
use Friendica\DI;
use Friendica\Model\Item;
use Friendica\Database\DBA;
+use Friendica\Model\Post;
function viewsrc_install() {
Hook::register('item_photo_menu', 'addon/viewsrc/viewsrc.php', 'viewsrc_item_photo_menu');
}
if (local_user() != $b['item']['uid']) {
- $item = Item::selectFirstForUser(local_user(), ['id'], ['uid' => local_user(), 'guid' => $b['item']['guid']]);
+ $item = Post::selectFirstForUser(local_user(), ['id'], ['uid' => local_user(), 'guid' => $b['item']['guid']]);
if (!DBA::isResult($item)) {
return;
}
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Item;
+use Friendica\Model\Post;
use Friendica\Model\User;
function windowsphonepush_install()
$senditemtext = DI::pConfig()->get($rr['uid'], 'windowsphonepush', 'senditemtext');
if ($senditemtext == 1) {
// load item with the max id
- $item = Item::selectFirst(['author-name', 'body'], ['id' => $count[0]['max']]);
+ $item = Post::selectFirst(['author-name', 'body'], ['id' => $count[0]['max']]);
// as user allows to send the item, we want to show the sender of the item in the toast
// toasts are limited to one line, therefore place is limited - author shall be in