mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:15:13 +00:00
xchan_instance_url was still being referenced, add expire app
This commit is contained in:
parent
395d7ba802
commit
0030bdac40
7 changed files with 37 additions and 4 deletions
|
@ -470,7 +470,7 @@ class Notifier {
|
|||
if(! count(self::$env_recips))
|
||||
self::$env_recips = ((self::$private) ? [] : null);
|
||||
|
||||
$details = q("select xchan_hash, xchan_instance_url, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . protect_sprintf(implode(',',self::$recipients)) . ")");
|
||||
$details = q("select xchan_hash, xchan_network, xchan_addr, xchan_guid, xchan_guid_sig from xchan where xchan_hash in (" . protect_sprintf(implode(',',self::$recipients)) . ")");
|
||||
|
||||
|
||||
$recip_list = array();
|
||||
|
|
|
@ -312,6 +312,7 @@ class Apps {
|
|||
'Chatrooms' => t('Chatrooms'),
|
||||
'Content Import' => t('Content Import'),
|
||||
'Connections' => t('Connections'),
|
||||
'Expire Posts' => t('Expire Posts'),
|
||||
'Remote Diagnostics' => t('Remote Diagnostics'),
|
||||
'Suggest Channels' => t('Suggest Channels'),
|
||||
'Login' => t('Login'),
|
||||
|
|
25
Zotlabs/Module/Expire.php
Normal file
25
Zotlabs/Module/Expire.php
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
|
||||
namespace Zotlabs\Module;
|
||||
|
||||
use Zotlabs\Lib\Apps;
|
||||
use Zotlabs\Lib\Libsync;
|
||||
use Zotlabs\Web\Controller;
|
||||
|
||||
class Expire extends Controller {
|
||||
|
||||
|
||||
function get() {
|
||||
|
||||
$desc = t('This app allows you to set an optional expiration date/time for posts, after which they will be deleted. This must be at least fifteen minutes into the future.');
|
||||
|
||||
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
|
||||
|
||||
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Expire Posts'))) {
|
||||
return $text;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -28,6 +28,7 @@ use Zotlabs\Lib\ThreadListener;
|
|||
use Zotlabs\Lib\Config;
|
||||
use Zotlabs\Lib\IConfig;
|
||||
use Zotlabs\Lib\Enotify;
|
||||
use Zotlabs\Lib\Apps;
|
||||
use App;
|
||||
|
||||
require_once('include/attach.php');
|
||||
|
@ -771,7 +772,7 @@ class Item extends Controller {
|
|||
|
||||
|
||||
|
||||
if(feature_enabled($profile_uid,'content_expire')) {
|
||||
if(Apps::system_app_installed($profile_uid,'Expire Posts')) {
|
||||
if(x($_REQUEST,'expire')) {
|
||||
$expires = datetime_convert(date_default_timezone_get(),'UTC', $_REQUEST['expire']);
|
||||
if($expires <= datetime_convert())
|
||||
|
|
6
app/expire.apd
Normal file
6
app/expire.apd
Normal file
|
@ -0,0 +1,6 @@
|
|||
version: 1
|
||||
url: $baseurl/expire
|
||||
requires: local_channel
|
||||
name: Expire Posts
|
||||
photo: icon:eraser
|
||||
categories: Networking
|
|
@ -1224,7 +1224,7 @@ function z_status_editor($a, $x, $popup = false) {
|
|||
if(x($x, 'disable_comments'))
|
||||
$feature_nocomment = false;
|
||||
|
||||
$feature_expire = ((feature_enabled($x['profile_uid'], 'content_expire') && (! $webpage)) ? true : false);
|
||||
$feature_expire = ((Apps::system_app_installed($x['profile_uid'], 'Expire Posts') && (! $webpage)) ? true : false);
|
||||
if(x($x, 'hide_expire'))
|
||||
$feature_expire = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue