From ac541a7d3246e1c5c60ae752326c1b9ba5ccd78f Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 14 Aug 2013 20:09:02 -0700 Subject: most of expire is now ported from friendica, but the protocol bits to push out the delete notifications for the entire batch to all recipients of the original post are not complete and will take quite a bit more work. As a consequence, expire has been completely disabled until it is fully implmented since it could result in completely un-removable posts reminiscent of the infamous "Bonnie Nadri" incident at Diaspora which we do not wish to re-live. --- include/features.php | 3 ++- include/notifier.php | 19 +++++++++++++++---- include/poller.php | 3 ++- view/tpl/settings.tpl | 4 ++++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/include/features.php b/include/features.php index da1322a14..757f719df 100644 --- a/include/features.php +++ b/include/features.php @@ -19,7 +19,8 @@ function get_features() { // General 'general' => array( t('General Features'), - array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')), +// uncomment when expire is fixed +// array('expire', t('Content Expiration'), t('Remove old posts/comments after a period of time')), array('multi_profiles', t('Multiple Profiles'), t('Ability to create multiple profiles')), array('webpages', t('Web Pages'), t('Provide managed web pages on your channel')), array('prettyphoto', t('Enhanced Photo Albums'), t('Enable photo album with enhanced features')), diff --git a/include/notifier.php b/include/notifier.php index a0c07200a..2a0301357 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -54,6 +54,7 @@ require_once('include/html2plain.php'); * ZOT * permission_update abook_id * refresh_all channel_id + * expire channel_id * relay item_id (item was relayed to owner, we will deliver it as owner) * */ @@ -166,14 +167,24 @@ function notifier_run($argv, $argc){ elseif($cmd === 'expire') { $normal_mode = false; $expire = true; - $items = q("SELECT * FROM `item` WHERE `uid` = %d AND `wall` = 1 - AND `deleted` = 1 AND `changed` > UTC_TIMESTAMP() - INTERVAL 10 MINUTE", - intval($item_id) + $items = q("SELECT * FROM item WHERE uid = %d AND ( item_flags & %d ) + AND ( item_restrict & %d ) AND `changed` > UTC_TIMESTAMP() - INTERVAL 10 MINUTE", + intval($item_id), + intval(ITEM_WALL), + intval(ITEM_DELETED) ); $uid = $item_id; $item_id = 0; - if(! count($items)) + if(! $items) return; + +// FIXME +// This will require a special zot packet containing a list of item message_id's to be expired. +// This packet will be public, since we cannot selectively deliver here. +// We need the handling on this end to create the array, and the handling on the remote end +// to verify permissions (for each item) and process it. Until this is complete, the expire feature will be disabled. + + return; } elseif($cmd === 'suggest') { $normal_mode = false; diff --git a/include/poller.php b/include/poller.php index 00914a712..7f76750b4 100644 --- a/include/poller.php +++ b/include/poller.php @@ -84,7 +84,8 @@ function poller_run($argv, $argc){ set_config('system','last_expire_day',$d2); - proc_run('php','include/expire.php'); +// Uncomment when expire protocol component is working +// proc_run('php','include/expire.php'); proc_run('php','include/cli_suggest.php'); diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl index 9a3a1ce8b..194b90e80 100755 --- a/view/tpl/settings.tpl +++ b/view/tpl/settings.tpl @@ -50,6 +50,9 @@ {{include file="field_input.tpl" field=$cntunkmail}} + +{{if $expireisfixed}} +{{* Remove above line when expire is working *}} {{include file="field_input.tpl" field=$expire.days}} @@ -65,6 +68,7 @@ +{{/if}}
{{$permissions}} {{$permdesc}} -- cgit v1.2.3