aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2019-05-01 10:06:24 +0200
committerMario <mario@mariovavti.com>2019-05-01 10:06:24 +0200
commit256f8dd41b9e22f2b16bf5d912228f84952c748a (patch)
tree4c874b220281b25c293e2ebe8bc6ddde19fa0801 /Zotlabs
parenta04689b7840f336fed92ec648754cca02dcd90f0 (diff)
parentc340416c9424c285de4701158714541f24d66e85 (diff)
downloadvolse-hubzilla-256f8dd41b9e22f2b16bf5d912228f84952c748a.tar.gz
volse-hubzilla-256f8dd41b9e22f2b16bf5d912228f84952c748a.tar.bz2
volse-hubzilla-256f8dd41b9e22f2b16bf5d912228f84952c748a.zip
Merge branch 'dev' into 'dev'
Add 'reply on comment' feature See merge request hubzilla/core!1614
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/ThreadItem.php10
-rw-r--r--Zotlabs/Module/Display.php2
-rw-r--r--Zotlabs/Module/Item.php16
3 files changed, 16 insertions, 12 deletions
diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php
index 40c0fca4b..31259f012 100644
--- a/Zotlabs/Lib/ThreadItem.php
+++ b/Zotlabs/Lib/ThreadItem.php
@@ -305,6 +305,7 @@ class ThreadItem {
if($this->is_commentable() && $observer) {
$like = array( t("I like this \x28toggle\x29"), t("like"));
$dislike = array( t("I don't like this \x28toggle\x29"), t("dislike"));
+ $reply_to = array( t("Reply on this comment"), t("reply"), t("Reply to"));
}
if ($shareable) {
@@ -348,9 +349,6 @@ class ThreadItem {
$list_unseen_txt = (($unseen_comments) ? sprintf('%d unseen',$unseen_comments) : '');
-
-
-
$children = $this->get_children();
$has_tags = (($body['tags'] || $body['categories'] || $body['mentions'] || $body['attachments'] || $body['folders']) ? true : false);
@@ -373,6 +371,8 @@ class ThreadItem {
'text' => strip_tags($body['html']),
'id' => $this->get_id(),
'mid' => $item['mid'],
+ 'parent' => $item['parent'],
+ 'author_id' => $item['author']['xchan_addr'],
'isevent' => $isevent,
'attend' => $attend,
'consensus' => $consensus,
@@ -425,9 +425,10 @@ class ThreadItem {
'has_tags' => $has_tags,
'reactions' => $this->reactions,
// Item toolbar buttons
- 'emojis' => (($this->is_toplevel() && $this->is_commentable() && $observer && feature_enabled($conv->get_profile_owner(),'emojis')) ? '1' : ''),
+ 'emojis' => (($this->is_toplevel() && $this->is_commentable() && $observer && feature_enabled($conv->get_profile_owner(),'emojis')) ? '1' : ''),
'like' => $like,
'dislike' => ((feature_enabled($conv->get_profile_owner(),'dislike')) ? $dislike : ''),
+ 'reply_to' => (((! $this->is_toplevel()) && feature_enabled($conv->get_profile_owner(),'reply_to')) ? $reply_to : ''),
'share' => $share,
'embed' => $embed,
'rawmid' => $item['mid'],
@@ -869,4 +870,3 @@ class ThreadItem {
}
-
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index 5983578b3..b7d4a5922 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -265,7 +265,7 @@ class Display extends \Zotlabs\Web\Controller {
$sysid = $sys['channel_id'];
if(local_channel()) {
- $r = q("SELECT item.id as item_id from item WHERE uid = %d and mid = '%s' $item_normal limit 1",
+ $r = q("SELECT item.parent as item_id from item WHERE uid = %d and mid = '%s' $item_normal limit 1",
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 6bc8c645f..11ce1d268 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -216,7 +216,7 @@ class Item extends Controller {
$parent = ((x($_REQUEST,'parent')) ? intval($_REQUEST['parent']) : 0);
$parent_mid = ((x($_REQUEST,'parent_mid')) ? trim($_REQUEST['parent_mid']) : '');
-
+
$remote_xchan = ((x($_REQUEST,'remote_xchan')) ? trim($_REQUEST['remote_xchan']) : false);
$r = q("select * from xchan where xchan_hash = '%s' limit 1",
dbesc($remote_xchan)
@@ -329,9 +329,14 @@ class Item extends Controller {
$obj_type = ACTIVITY_OBJ_COMMENT;
if($parent) {
- $r = q("SELECT * FROM item WHERE id = %d LIMIT 1",
+ // Get commented post data
+ $rr = q("SELECT parent, mid FROM item WHERE id = %d LIMIT 1",
intval($parent)
);
+ // and its parent
+ $r = q("SELECT * FROM item WHERE id = %d LIMIT 1",
+ intval($rr[0]['parent'])
+ );
}
elseif($parent_mid && $uid) {
// This is coming from an API source, and we are logged in
@@ -910,8 +915,7 @@ class Item extends Controller {
}
if($parent_item)
- $parent_mid = $parent_item['mid'];
-
+ $parent_mid = $rr[0]['mid'];
// Fallback so that we alway have a thr_parent
@@ -1014,7 +1018,7 @@ class Item extends Controller {
$datarray['term'] = $post_tags;
$datarray['plink'] = $plink;
$datarray['route'] = $route;
-
+
// A specific ACL over-rides public_policy completely
@@ -1160,7 +1164,7 @@ class Item extends Controller {
'verb' => ACTIVITY_POST,
'otype' => 'item',
'parent' => $parent,
- 'parent_mid' => $parent_item['mid']
+ 'parent_mid' => $rr[0]['mid']
));
}