diff options
author | friendica <info@friendica.com> | 2015-03-24 20:38:53 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-03-24 20:38:53 -0700 |
commit | 022305fe8383be238a442efdbd5ba3463d15b7ab (patch) | |
tree | ff9d3832f5a305eadd435d385f847d9900994dfa | |
parent | 63b8020969434756a7b966ae615c28bf7680f2f8 (diff) | |
download | volse-hubzilla-022305fe8383be238a442efdbd5ba3463d15b7ab.tar.gz volse-hubzilla-022305fe8383be238a442efdbd5ba3463d15b7ab.tar.bz2 volse-hubzilla-022305fe8383be238a442efdbd5ba3463d15b7ab.zip |
also allow service classes to set post expiration. These take priority over the site default.
-rw-r--r-- | doc/diaspora_compat.md | 3 | ||||
-rw-r--r-- | include/expire.php | 22 | ||||
-rwxr-xr-x | include/items.php | 6 | ||||
-rw-r--r-- | mod/siteinfo.php | 7 |
4 files changed, 23 insertions, 15 deletions
diff --git a/doc/diaspora_compat.md b/doc/diaspora_compat.md index 3829a9c64..eb7ec656d 100644 --- a/doc/diaspora_compat.md +++ b/doc/diaspora_compat.md @@ -11,6 +11,9 @@ Access control only works on posts and comments. Diaspora members will get permi Edited posts will not be delivered. Diaspora members will see the original post/comment without edits. There is no mechanism in the protocol to update an existing post. We cannot delete it and submit another invisibly because the message-id will change and we need to keep the same message-id on our own network. The only workaround is to delete the post/comment and do it over. We may eventually provide a way to delete the out of date copy only from Diaspora and keep it intact on networks that can handle edits. +Some comments from external services will not deliver to Diaspora, as they have no Diaspora service discovery. Currently this applies to comments from WordPress blogs which are imported into your stream; but will extend to most any service that has no Diaspora discover mechanism. + + Nomadic identity will not work with Diaspora. We will eventually provide an **option** which will allow you to "start sharing" from all of your clones when you make the first connection. The Diaspora person does not have to accept this, but it will allow your communications to continue if they accept this connection. Without this option, if you go to another server from where you made the connection originally or you make the connection before creating the clone, you will need to make friends with them again from the new location. Post expiration is not supported on Diaspora. We will provide you an option to not send expiring posts to that network. In the future this may be provided with a remote delete request. diff --git a/include/expire.php b/include/expire.php index e414a6e7d..b244e65f5 100644 --- a/include/expire.php +++ b/include/expire.php @@ -41,12 +41,7 @@ function expire_run($argv, $argc){ logger('site_expire: ' . $site_expire); - if(intval($site_expire)) { - $r = q("SELECT channel_id, channel_address, channel_pageflags, channel_expire_days from channel where true"); - } - else { - $r = q("SELECT channel_id, channel_address, channel_pageflags, channel_expire_days from channel where channel_expire_days != 0"); - } + $r = q("SELECT channel_id, channel_address, channel_pageflags, channel_expire_days from channel where true"); if($r) { foreach($r as $rr) { @@ -55,16 +50,23 @@ function expire_run($argv, $argc){ if($rr['channel_pageflags'] & PAGE_SYSTEM) continue; - if(intval($site_expire) && (intval($site_expire) < intval($rr['channel_expire_days'])) || + // service class default (if non-zero) over-rides the site default + + $service_class_expire = service_class_fetch($rr['channel_id'],'expire_days'); + if(intval($service_class_expire)) + $channel_expire = $service_class_expire; + else + $channel_expire = $site_expire; + + if(intval($channel_expire) && (intval($channel_expire) < intval($rr['channel_expire_days'])) || intval($rr['channel_expire_days'] == 0)) { - $expire_days = $site_expire; + $expire_days = $channel_expire; } else { $expire_days = $rr['channel_expire_days']; } - - // if the site expiration is non-zero and less than person expiration, use that + // if the site or service class expiration is non-zero and less than person expiration, use that logger('Expire: ' . $rr['channel_address'] . ' interval: ' . $expire_days, LOGGER_DEBUG); item_expire($rr['channel_id'], $expire_days); } diff --git a/include/items.php b/include/items.php index da0e50c4c..a8947202d 100755 --- a/include/items.php +++ b/include/items.php @@ -3926,15 +3926,15 @@ function item_expire($uid,$days) { if(! intval($expire_limit)) $expire_limit = 5000; - $sql_extra = ((intval($expire_network_only)) ? " AND not (item_flags & " . intval(ITEM_WALL) . ") > 0 " : ""); + $sql_extra = ((intval($expire_network_only)) ? " AND (item_flags & " . intval(ITEM_WALL) . ") = 0 " : ""); $r = q("SELECT * FROM `item` WHERE `uid` = %d AND `created` < %s - INTERVAL %s AND `id` = `parent` $sql_extra - AND NOT ( item_flags & %d )>0 - AND (item_restrict = 0 ) LIMIT $expire_limit ", + AND ( item_flags & %d ) = 0 + AND ( item_restrict = 0 ) LIMIT $expire_limit ", intval($uid), db_utcnow(), db_quoteinterval(intval($days).' DAY'), intval(ITEM_RETAINED) diff --git a/mod/siteinfo.php b/mod/siteinfo.php index 2ad9f7cde..ab6891e25 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -72,6 +72,8 @@ function siteinfo_init(&$a) { $channels_active_monthly_stat = intval(get_config('system','channels_active_monthly_stat')); $local_posts_stat = intval(get_config('system','local_posts_stat')); $hide_in_statistics = intval(get_config('system','hide_in_statistics')); + $site_expire = intval(get_config('system', 'default_expire_days')); + $data = Array( 'version' => $version, @@ -84,6 +86,7 @@ function siteinfo_init(&$a) { 'language' => get_config('system','language'), 'diaspora_emulation' => get_config('system','diaspora_enabled'), 'rss_connections' => get_config('system','feed_contacts'), + 'expiration' => $site_expire, 'default_service_restrictions' => $service_class, 'admin' => $admin, 'site_name' => (($site_name) ? $site_name : ''), @@ -150,7 +153,7 @@ function siteinfo_content(&$a) { $o = replace_macros(get_markup_template('siteinfo.tpl'), array( '$title' => t('Red'), - '$description' => t('This is a hub of the Red Matrix - a global cooperative network of decentralized privacy enhanced websites.'), + '$description' => t('This is a hub of redmatrix - a global cooperative network of decentralized privacy enhanced websites.'), '$version' => $version, '$tag_txt' => t('Tag: '), '$tag' => $tag, @@ -158,7 +161,7 @@ function siteinfo_content(&$a) { '$lastpoll' => get_poller_runtime(), '$commit' => $commit, '$web_location' => t('Running at web location') . ' ' . z_root(), - '$visit' => t('Please visit <a href="https://redmatrix.me">RedMatrix.me</a> to learn more about the Red Matrix.'), + '$visit' => t('Please visit <a href="https://redmatrix.me">redmatrix.me</a> to learn more about the Red Matrix.'), '$bug_text' => t('Bug reports and issues: please visit'), '$bug_link_url' => 'https://github.com/friendica/red/issues', '$bug_link_text' => 'redmatrix issues', |