From 9d156141b1205e48bbb3008f2a3040caa4c33192 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 19 Jun 2019 17:32:38 -0700 Subject: changes to support direct messages in zot6 (set item.item_private = 2 when private mentions are used and federate with zot:directMessage attribute which aligns with litepub:directMessage) --- Zotlabs/Module/Apschema.php | 3 ++- Zotlabs/Module/Item.php | 11 +++++------ Zotlabs/Module/Lockview.php | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Apschema.php b/Zotlabs/Module/Apschema.php index d217041f2..ef2264bc0 100644 --- a/Zotlabs/Module/Apschema.php +++ b/Zotlabs/Module/Apschema.php @@ -28,7 +28,8 @@ class Apschema extends \Zotlabs\Web\Controller { 'nomadicHubs' => 'zot:nomadicHubs', 'emojiReaction' => 'zot:emojiReaction', 'expires' => 'zot:expires', - + 'directMessage' => 'zot:directMessage', + 'magicEnv' => [ '@id' => 'zot:magicEnv', '@type' => '@id' diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 965cbf173..901f54c72 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -551,10 +551,10 @@ class Item extends Controller { $public_policy = $orig_post['public_policy']; $private = $orig_post['item_private']; } - - if($private || $public_policy || $acl->is_private()) - $private = 1; - + + if($public_policy || $acl->is_private()) { + $private = (($private) ? $private : 1); + } $location = $orig_post['location']; $coord = $orig_post['coord']; @@ -631,12 +631,11 @@ class Item extends Controller { $allow_empty = ((array_key_exists('allow_empty',$_REQUEST)) ? intval($_REQUEST['allow_empty']) : 0); - $private = intval($acl->is_private() || ($public_policy)); + $private = (($private) ? $private : intval($acl->is_private() || ($public_policy))); // If this is a comment, set the permissions from the parent. if($parent_item) { - $private = 0; $acl->set($parent_item); $private = intval($acl->is_private() || $parent_item['item_private']); $public_policy = $parent_item['public_policy']; diff --git a/Zotlabs/Module/Lockview.php b/Zotlabs/Module/Lockview.php index d7ed07a53..8c8519c57 100644 --- a/Zotlabs/Module/Lockview.php +++ b/Zotlabs/Module/Lockview.php @@ -76,7 +76,7 @@ class Lockview extends \Zotlabs\Web\Controller { killme(); } - if(($item['item_private'] == 1) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) + if(intval($item['item_private']) && (! strlen($item['allow_cid'])) && (! strlen($item['allow_gid'])) && (! strlen($item['deny_cid'])) && (! strlen($item['deny_gid']))) { // if the post is private, but public_policy is blank ("visible to the internet"), and there aren't any -- cgit v1.2.3 From c1cc76119cf055c50045af24df07040fa32d2bf6 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 19 Jun 2019 21:41:46 -0700 Subject: events: don't use htmlentities on local (hz) event titles as they are not being used in textareas and umlauts for instance are getting mangled on the calendar display --- Zotlabs/Module/Channel_calendar.php | 4 ++-- Zotlabs/Module/Events.php | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php index 4f08eb27c..9a735ffc5 100644 --- a/Zotlabs/Module/Channel_calendar.php +++ b/Zotlabs/Module/Channel_calendar.php @@ -381,7 +381,7 @@ class Channel_calendar extends \Zotlabs\Web\Controller { 'end' => $end, 'drop' => $drop, 'allDay' => (($rr['adjust']) ? 0 : 1), - 'title' => htmlentities($rr['summary'], ENT_COMPAT, 'UTF-8', false), + 'title' => $rr['summary'], 'editable' => $edit ? true : false, 'item' => $rr, 'plink' => [$rr['plink'], t('Link to source')], @@ -402,7 +402,7 @@ class Channel_calendar extends \Zotlabs\Web\Controller { echo ical_wrapper($r); killme(); } - + if (\App::$argv[1] === 'json'){ json_return_and_die($events); } diff --git a/Zotlabs/Module/Events.php b/Zotlabs/Module/Events.php index e883db49f..056d0cd5a 100644 --- a/Zotlabs/Module/Events.php +++ b/Zotlabs/Module/Events.php @@ -662,9 +662,10 @@ class Events extends \Zotlabs\Web\Controller { 'html'=>$html, 'plink' => array($rr['plink'],t('Link to Source'),'',''), ); + } } - + if($export) { header('Content-type: text/calendar'); header('content-disposition: attachment; filename="' . t('calendar') . '-' . $channel['channel_address'] . '.ics"' ); -- cgit v1.2.3 From 952e466d9121726f00c94b6527ff01255529b82c Mon Sep 17 00:00:00 2001 From: zotlabs Date: Wed, 19 Jun 2019 22:13:03 -0700 Subject: tweak to event title encoding to ensure it works with German, Russian, as well as angle chars --- Zotlabs/Module/Channel_calendar.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Zotlabs/Module') diff --git a/Zotlabs/Module/Channel_calendar.php b/Zotlabs/Module/Channel_calendar.php index 9a735ffc5..cacee57ef 100644 --- a/Zotlabs/Module/Channel_calendar.php +++ b/Zotlabs/Module/Channel_calendar.php @@ -381,7 +381,7 @@ class Channel_calendar extends \Zotlabs\Web\Controller { 'end' => $end, 'drop' => $drop, 'allDay' => (($rr['adjust']) ? 0 : 1), - 'title' => $rr['summary'], + 'title' => html_entity_decode($rr['summary'],ENT_COMPAT,'UTF-8'), 'editable' => $edit ? true : false, 'item' => $rr, 'plink' => [$rr['plink'], t('Link to source')], -- cgit v1.2.3