aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2019-05-01 21:40:43 +0200
committerMax Kostikov <max@kostikov.co>2019-05-01 21:40:43 +0200
commit51a0fc45e2a9e95ce37dbe9a792d4281e0baf07b (patch)
treea9e1f4e6ca6c764fa699a0edfa59f964f70a198c /Zotlabs
parent0174bf372297f353b5934ff6c42b4dac44c913bd (diff)
downloadvolse-hubzilla-51a0fc45e2a9e95ce37dbe9a792d4281e0baf07b.tar.gz
volse-hubzilla-51a0fc45e2a9e95ce37dbe9a792d4281e0baf07b.tar.bz2
volse-hubzilla-51a0fc45e2a9e95ce37dbe9a792d4281e0baf07b.zip
Add threaded comments support
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Activity.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 5c3002837..12194664b 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -195,6 +195,13 @@ class Activity {
if(! $ev['nofinish']) {
$y['endTime'] = (($ev['adjust']) ? datetime_convert('UTC','UTC',$ev['dtend'], ATOM_TIME) : datetime_convert('UTC','UTC',$ev['dtend'],'Y-m-d\\TH:i:s-00:00'));
}
+
+ // copy attachments from the passed object - these are already formatted for ActivityStreams
+
+ if($x['attachment']) {
+ $y['attachment'] = $x['attachment'];
+ }
+
if($actor) {
return $y;
}
@@ -303,7 +310,7 @@ class Activity {
$ret['attributedTo'] = $i['author']['xchan_url'];
if($i['id'] != $i['parent']) {
- $ret['inReplyTo'] = ((strpos($i['parent_mid'],'http') === 0) ? $i['parent_mid'] : z_root() . '/item/' . urlencode($i['parent_mid']));
+ $ret['inReplyTo'] = ((strpos($i['thr_parent'],'http') === 0) ? $i['thr_parent'] : z_root() . '/item/' . urlencode($i['thr_parent']));
}
if($i['mimetype'] === 'text/bbcode') {
@@ -404,7 +411,7 @@ class Activity {
$ret = [];
if($item['attach']) {
- $atts = json_decode($item['attach'],true);
+ $atts = ((is_array($item['attach'])) ? $item['attach'] : json_decode($item['attach'],true));
if($atts) {
foreach($atts as $att) {
if(strpos($att['type'],'image')) {
@@ -416,7 +423,7 @@ class Activity {
}
}
}
-
+
return $ret;
}
@@ -502,7 +509,7 @@ class Activity {
}
if($i['id'] != $i['parent']) {
- $ret['inReplyTo'] = ((strpos($i['parent_mid'],'http') === 0) ? $i['parent_mid'] : z_root() . '/item/' . urlencode($i['parent_mid']));
+ $ret['inReplyTo'] = ((strpos($i['thr_parent'],'http') === 0) ? $i['thr_parent'] : z_root() . '/item/' . urlencode($i['thr_parent']));
$reply = true;
if($i['item_private']) {