mirror of
https://github.com/friendica/friendica
synced 2025-04-30 00:24:24 +02:00
"selectForUser" and "" selectFirstForUser" is now moved to Post
This commit is contained in:
parent
c1226bff07
commit
2b1d0b9db8
29 changed files with 179 additions and 121 deletions
|
@ -1296,9 +1296,9 @@ class Contact
|
|||
}
|
||||
|
||||
if (empty($contact["network"]) || in_array($contact["network"], Protocol::FEDERATED)) {
|
||||
$sql = "(`item`.`uid` = 0 OR (`item`.`uid` = ? AND NOT `item`.`global`))";
|
||||
$sql = "(`uid` = 0 OR (`uid` = ? AND NOT `global`))";
|
||||
} else {
|
||||
$sql = "`item`.`uid` = ?";
|
||||
$sql = "`uid` = ?";
|
||||
}
|
||||
|
||||
$contact_field = ((($contact["contact-type"] == self::TYPE_COMMUNITY) || ($contact['network'] == Protocol::MAIL)) ? 'owner-id' : 'author-id');
|
||||
|
@ -1340,18 +1340,11 @@ class Contact
|
|||
}
|
||||
|
||||
if ($thread_mode) {
|
||||
$r = Item::selectForUser(local_user(), ['uri', 'gravity', 'parent-uri', 'thr-parent-id', 'author-id'], $condition, $params);
|
||||
$items = [];
|
||||
while ($item = DBA::fetch($r)) {
|
||||
$items[] = $item;
|
||||
}
|
||||
DBA::close($r);
|
||||
$items = Post::toArray(Post::selectForUser(local_user(), ['uri', 'gravity', 'parent-uri', 'thr-parent-id', 'author-id'], $condition, $params));
|
||||
|
||||
$o .= conversation($a, $items, 'contacts', $update, false, 'commented', local_user());
|
||||
} else {
|
||||
$r = Item::selectForUser(local_user(), [], $condition, $params);
|
||||
|
||||
$items = Item::inArray($r);
|
||||
$items = Post::toArray(Post::selectForUser(local_user(), [], $condition, $params));
|
||||
|
||||
$o .= conversation($a, $items, 'contact-posts', $update);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue