aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Item.php
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs/Module/Item.php')
-rw-r--r--Zotlabs/Module/Item.php36
1 files changed, 15 insertions, 21 deletions
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 83424a50d..bc35ac452 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -132,13 +132,14 @@ class Item extends Controller {
$i = Activity::encode_item_collection($items, 'conversation/' . $item_id, 'OrderedCollection');
- if($portable_id) {
- ThreadListener::store(z_root() . '/item/' . $item_id,$portable_id);
- }
if(! $i)
http_status_exit(404, 'Not found');
+ if($portable_id && (! intval($items[0]['item_private']))) {
+ ThreadListener::store(z_root() . '/item/' . $item_id, $portable_id);
+ }
+
$x = array_merge(['@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1',
@@ -237,6 +238,16 @@ class Item extends Controller {
if(! $i)
http_status_exit(404, 'Not found');
+ if ($portable_id && (! intval($items[0]['item_private']))) {
+ $c = q("select abook_id from abook where abook_channel = %d and abook_xchan = '%s'",
+ intval($items[0]['uid']),
+ dbesc($portable_id)
+ );
+ if (! $c) {
+ ThreadListener::store(z_root() . '/item/' . $item_id, $portable_id);
+ }
+ }
+
$x = array_merge(['@context' => [
ACTIVITYSTREAMS_JSONLD_REV,
'https://w3id.org/security/v1',
@@ -810,18 +821,7 @@ class Item extends Controller {
// and will require alternatives for alternative content-types (text/html, text/markdown, text/plain, etc.)
// we may need virtual or template classes to implement the possible alternatives
- if(strpos($body,'[/summary]') !== false) {
- $match = '';
- $cnt = preg_match("/\[summary\](.*?)\[\/summary\]/ism",$body,$match);
- if($cnt) {
- $summary .= $match[1];
- }
- $body_content = preg_replace("/\[summary\](.*?)\[\/summary\]/ism", '',$body);
- $body = trim($body_content);
- }
-
$summary = cleanup_bbcode($summary);
-
$body = cleanup_bbcode($body);
// Look for tags and linkify them
@@ -876,15 +876,10 @@ class Item extends Controller {
if(! $preview) {
fix_attached_photo_permissions($profile_uid,$owner_xchan['xchan_hash'],((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny);
-
fix_attached_photo_permissions($profile_uid,$owner_xchan['xchan_hash'],((strpos($summary,'[/crypt]')) ? $_POST['media_str'] : $summary),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny);
-
-
fix_attached_file_permissions($channel,$observer['xchan_hash'],((strpos($body,'[/crypt]')) ? $_POST['media_str'] : $body),$str_contact_allow,$str_group_allow,$str_contact_deny,$str_group_deny);
-
}
-
$attachments = '';
$match = false;
@@ -922,10 +917,9 @@ class Item extends Controller {
}
}
+ // BBCODE end alert
}
- // BBCODE end alert
-
if(strlen($categories)) {
$cats = explode(',',$categories);