From 0030bdac40b80665671b388edc070627b8031bc7 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sun, 24 Mar 2019 22:46:31 -0700 Subject: [PATCH] xchan_instance_url was still being referenced, add expire app --- Zotlabs/Daemon/Notifier.php | 2 +- Zotlabs/Lib/Apps.php | 1 + Zotlabs/Module/Categories.php | 2 +- Zotlabs/Module/Expire.php | 25 +++++++++++++++++++++++++ Zotlabs/Module/Item.php | 3 ++- app/expire.apd | 6 ++++++ include/conversation.php | 2 +- 7 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 Zotlabs/Module/Expire.php create mode 100644 app/expire.apd diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 9c94b9dd9..53cbab0d6 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -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(); diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php index 2b249e135..6744ebf9c 100644 --- a/Zotlabs/Lib/Apps.php +++ b/Zotlabs/Lib/Apps.php @@ -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'), diff --git a/Zotlabs/Module/Categories.php b/Zotlabs/Module/Categories.php index 92d638086..569db1f55 100644 --- a/Zotlabs/Module/Categories.php +++ b/Zotlabs/Module/Categories.php @@ -22,4 +22,4 @@ class Categories extends Controller { } -} \ No newline at end of file +} diff --git a/Zotlabs/Module/Expire.php b/Zotlabs/Module/Expire.php new file mode 100644 index 000000000..4e3a44d55 --- /dev/null +++ b/Zotlabs/Module/Expire.php @@ -0,0 +1,25 @@ +' . $desc . ''; + + if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Expire Posts'))) { + return $text; + } + + } + + +} diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index b2bf2b277..6ff51dfa3 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -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()) diff --git a/app/expire.apd b/app/expire.apd new file mode 100644 index 000000000..7a29e5ab0 --- /dev/null +++ b/app/expire.apd @@ -0,0 +1,6 @@ +version: 1 +url: $baseurl/expire +requires: local_channel +name: Expire Posts +photo: icon:eraser +categories: Networking diff --git a/include/conversation.php b/include/conversation.php index f67b30cb6..a15556e11 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -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;