aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2025-05-27 08:04:36 +0000
committerMario <mario@mariovavti.com>2025-05-27 08:04:36 +0000
commit8d1fea7ec326de674f4130de02b8d6fba4165056 (patch)
tree9623a15f7aa91ba443be39f7f4604ae58fa56e76 /Zotlabs/Module
parent3535cb3b96f917bf0d1e33f870a95bc64920530f (diff)
downloadvolse-hubzilla-8d1fea7ec326de674f4130de02b8d6fba4165056.tar.gz
volse-hubzilla-8d1fea7ec326de674f4130de02b8d6fba4165056.tar.bz2
volse-hubzilla-8d1fea7ec326de674f4130de02b8d6fba4165056.zip
new version of items_by_parent_ids() and item_reaction_sql() with much better performance, streamline rsvp naming convention and some preparatory work for comment lazy loading (unfinshed)
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Channel.php9
-rw-r--r--Zotlabs/Module/Display.php2
-rw-r--r--Zotlabs/Module/Hq.php2
-rw-r--r--Zotlabs/Module/Like.php14
-rw-r--r--Zotlabs/Module/Network.php6
-rw-r--r--Zotlabs/Module/Pubstream.php6
-rw-r--r--Zotlabs/Module/Request.php6
7 files changed, 15 insertions, 30 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 93803da18..27c627e34 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -417,14 +417,7 @@ class Channel extends Controller {
}
}
if ($r) {
- //$parents_str = ids_to_querystr($r, 'item_id');
-
- //$r = items_by_parent_ids($parents_str, permission_sql: $permission_sql, blog_mode: $blog_mode);
- $items = [];
- foreach($r as $parent) {
- $nitems = items_by_parent_id($parent['item_id'], permission_sql: $permission_sql, blog_mode: $blog_mode);
- $items = array_merge($items, $nitems);
- }
+ $items = items_by_parent_ids($r, permission_sql: $permission_sql, blog_mode: $blog_mode);
xchan_query($items);
$items = fetch_post_tags($items, true);
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index d3657149f..094466665 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -289,7 +289,7 @@ class Display extends Controller {
if($r) {
$thr_parents = get_recursive_thr_parents($target_item);
- $items = items_by_parent_id($r[0]['item_id'], $thr_parents, $permission_sql);
+ $items = items_by_parent_ids($r, $thr_parents, $permission_sql);
xchan_query($items);
$items = fetch_post_tags($items,true);
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index c4f812854..241a5101a 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -201,7 +201,7 @@ class Hq extends \Zotlabs\Web\Controller {
if($r) {
$thr_parents = get_recursive_thr_parents($target_item);
- $items = items_by_parent_id($r[0]['item_id'], $thr_parents);
+ $items = items_by_parent_ids($r, $thr_parents);
xchan_query($items,true,(($sys_item) ? local_channel() : 0));
$items = fetch_post_tags($items,true);
diff --git a/Zotlabs/Module/Like.php b/Zotlabs/Module/Like.php
index 218d35f1e..e704c397e 100644
--- a/Zotlabs/Module/Like.php
+++ b/Zotlabs/Module/Like.php
@@ -22,9 +22,9 @@ class Like extends Controller {
'like' => 'Like',
'dislike' => 'Dislike',
'announce' => ACTIVITY_SHARE,
- 'attendyes' => 'Accept',
- 'attendno' => 'Reject',
- 'attendmaybe' => 'TentativeAccept'
+ 'accept' => 'Accept',
+ 'reject' => 'Reject',
+ 'tentativeaccept' => 'TentativeAccept'
];
// unlike (etc.) reactions are an undo of positive reactions, rather than a negative action.
@@ -474,11 +474,11 @@ class Like extends Controller {
$bodyverb = t('%1$s likes %2$s\'s %3$s');
if ($verb === 'dislike')
$bodyverb = t('%1$s doesn\'t like %2$s\'s %3$s');
- if ($verb === 'attendyes')
+ if ($verb === 'accept')
$bodyverb = t('%1$s is attending %2$s\'s %3$s');
- if ($verb === 'attendno')
+ if ($verb === 'reject')
$bodyverb = t('%1$s is not attending %2$s\'s %3$s');
- if ($verb === 'attendmaybe')
+ if ($verb === 'tentativeaccept')
$bodyverb = t('%1$s may attend %2$s\'s %3$s');
if (!isset($bodyverb))
@@ -561,7 +561,7 @@ class Like extends Controller {
call_hooks('post_local_end', $arr);
- if ($is_rsvp && in_array($verb, ['attendyes', 'attendmaybe'])) {
+ if ($is_rsvp && in_array($verb, ['accept', 'tentativeaccept'])) {
event_addtocal($item_id, local_channel());
}
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index 6dd00f13c..f95d92fe2 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -507,11 +507,7 @@ class Network extends \Zotlabs\Web\Controller {
// Then fetch all the children of the parents that are on this page
if($r) {
- $items = [];
- foreach($r as $parent) {
- $nitems = items_by_parent_id($parent['item_id'], blog_mode: $blog_mode);
- $items = array_merge($items, $nitems);
- }
+ $items = items_by_parent_ids($r, blog_mode: $blog_mode);
xchan_query($items, true);
$items = fetch_post_tags($items, true);
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index 2944e496a..99b8ab587 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -251,11 +251,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
$parents_str = '';
if($r) {
- $items = [];
- foreach($r as $parent) {
- $nitems = items_by_parent_id($parent['item_id']);
- $items = array_merge($items, $nitems);
- }
+ $items = items_by_parent_ids($r);
// use effective_uid param of xchan_query to help sort out comment permission
// for sys_channel owned items.
diff --git a/Zotlabs/Module/Request.php b/Zotlabs/Module/Request.php
index bfd75ad95..0174694b2 100644
--- a/Zotlabs/Module/Request.php
+++ b/Zotlabs/Module/Request.php
@@ -12,9 +12,9 @@ class Request extends Controller
'like' => 'Like',
'dislike' => 'Dislike',
'announce' => 'Announce',
- 'attendyes' => 'Accept',
- 'attendno' => 'Reject',
- 'attendmaybe' => 'TentativeAccept'
+ 'accept' => 'Accept',
+ 'reject' => 'Reject',
+ 'tentativeaccept' => 'TentativeAccept'
];
if (array_key_exists($verb, $verbs)) {