aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module')
-rw-r--r--Zotlabs/Module/Channel.php15
-rw-r--r--Zotlabs/Module/Display.php15
-rw-r--r--Zotlabs/Module/Hq.php2
-rw-r--r--Zotlabs/Module/Like.php16
-rw-r--r--Zotlabs/Module/Network.php4
-rw-r--r--Zotlabs/Module/Pubstream.php5
-rw-r--r--Zotlabs/Module/Request.php21
7 files changed, 42 insertions, 36 deletions
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 9671cedf3..f73f25d5f 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -337,7 +337,7 @@ class Channel extends Controller {
if (($update) && (!$load)) {
if ($mid) {
- $r = q("SELECT parent AS item_id from item where $identifier = '%s' and uid = %d $item_normal_update
+ $r = q("SELECT *, parent AS item_id from item where $identifier = '%s' and uid = %d $item_normal_update
AND item_wall = 1 $simple_update $permission_sql $sql_extra limit 1",
dbesc($mid),
intval(App::$profile['profile_uid'])
@@ -386,7 +386,7 @@ class Channel extends Controller {
if ($noscript_content || $load) {
if ($mid) {
- $r = q("SELECT parent AS item_id from item where $identifier = '%s' and uid = %d $item_normal
+ $r = q("SELECT *, parent AS item_id from item where $identifier = '%s' and uid = %d $item_normal
AND item_wall = 1 $permission_sql $sql_extra limit 1",
dbesc($mid),
intval(App::$profile['profile_uid'])
@@ -417,12 +417,15 @@ class Channel extends Controller {
}
}
if ($r) {
- $parents_str = ids_to_querystr($r, 'item_id');
+ $thr_parents = null;
+ if ($mid) {
+ $thr_parents = get_recursive_thr_parents($r[0]);
+ }
- $r = items_by_parent_ids($parents_str, permission_sql: $permission_sql, blog_mode: $blog_mode);
+ $items = items_by_parent_ids($r, $thr_parents, $permission_sql, $blog_mode);
- xchan_query($r);
- $items = fetch_post_tags($r, true);
+ xchan_query($items);
+ $items = fetch_post_tags($items, true);
$items = conv_sort($items, $ordering);
if ($load && $mid && (!count($items))) {
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 07973431c..094466665 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -288,15 +288,12 @@ class Display extends Controller {
}
if($r) {
- $parents_str = ids_to_querystr($r,'item_id');
- if($parents_str) {
- $thr_parents = get_recursive_thr_parents($target_item);
- $items = items_by_parent_ids($parents_str, $thr_parents, $permission_sql);
-
- xchan_query($items);
- $items = fetch_post_tags($items,true);
- $items = conv_sort($items,'created');
- }
+ $thr_parents = get_recursive_thr_parents($target_item);
+ $items = items_by_parent_ids($r, $thr_parents, $permission_sql);
+
+ xchan_query($items);
+ $items = fetch_post_tags($items,true);
+ $items = conv_sort($items,'created');
}
else {
$items = array();
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index 562278973..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_ids($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..52c559a17 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.
@@ -67,7 +67,7 @@ class Like extends Controller {
$items = conv_sort($items, 'commented');
}
else {
- $item = item_by_item_id($arr['item']['id']);
+ $item = item_by_item_id($arr['item']['id'], $arr['item']['parent']);
xchan_query($item, true);
$item = fetch_post_tags($item, true);
}
@@ -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 fd30adccc..f95d92fe2 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -507,9 +507,7 @@ class Network extends \Zotlabs\Web\Controller {
// Then fetch all the children of the parents that are on this page
if($r) {
- $parents_str = ids_to_querystr($r, 'item_id');
-
- $items = items_by_parent_ids($parents_str, blog_mode: $blog_mode);
+ $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 79245f9c2..99b8ab587 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -251,10 +251,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
$parents_str = '';
if($r) {
-
- $parents_str = ids_to_querystr($r,'item_id');
-
- $items = items_by_parent_ids($parents_str);
+ $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..439f56282 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)) {
@@ -29,13 +29,24 @@ class Request extends Controller
{
$mid = $_GET['mid'];
$parent = intval($_GET['parent']);
+
+ $offset = null;
+ if ($_GET['verb'] === 'load') {
+ $offset = intval($_GET['offset']);
+ }
+
$module = strip_tags($_GET['module']);
- $items = items_by_thr_parent($mid, $parent);
+ $items = items_by_thr_parent($mid, $parent, $offset);
xchan_query($items);
$items = fetch_post_tags($items,true);
+ if ($module === 'channel') {
+ $parts = explode('@', $items[0]['owner']['xchan_addr']);
+ profile_load($parts[0]);
+ }
+
$ret['html'] = conversation($items, $module, true, 'r_preview');
json_return_and_die($ret);
@@ -44,7 +55,7 @@ class Request extends Controller
public function get() : string
{
- if ($_GET['verb'] === 'comment') {
+ if (in_array($_GET['verb'], ['comment', 'load'])) {
return self::processSubthreadRequest();
}