re-package browser-to-browser encryption as 'secrets' app

This commit is contained in:
nobody 2020-08-23 17:32:33 -07:00
parent e151e230ba
commit bbe7fab8bb
6 changed files with 38 additions and 3 deletions

View file

@ -335,6 +335,7 @@ class Apps {
'Channel Manager' => t('Channel Manager'), 'Channel Manager' => t('Channel Manager'),
'Notes' => t('Notes'), 'Notes' => t('Notes'),
'Stream' => t('Stream'), 'Stream' => t('Stream'),
'Secrets' => t('Secrets'),
'Settings' => t('Settings'), 'Settings' => t('Settings'),
'Files' => t('Files'), 'Files' => t('Files'),
'Webpages' => t('Webpages'), 'Webpages' => t('Webpages'),

View file

@ -944,7 +944,7 @@ class ThreadItem {
'$reset' => t('Reset'), '$reset' => t('Reset'),
'$indent' => $indent, '$indent' => $indent,
'$can_upload' => (perm_is_allowed($conv->get_profile_owner(),get_observer_hash(),'write_storage') && $conv->is_uploadable()), '$can_upload' => (perm_is_allowed($conv->get_profile_owner(),get_observer_hash(),'write_storage') && $conv->is_uploadable()),
'$feature_encrypt' => ((feature_enabled($conv->get_profile_owner(),'content_encrypt')) ? true : false), '$feature_encrypt' => ((Apps::system_app_installed($conv->get_profile_owner(),'Secrets')) ? true : false),
'$encrypt' => t('Encrypt text'), '$encrypt' => t('Encrypt text'),
'$cipher' => $conv->get_cipher(), '$cipher' => $conv->get_cipher(),
'$sourceapp' => App::$sourcename, '$sourceapp' => App::$sourcename,

View file

@ -205,7 +205,7 @@ class Chat extends Controller {
'$drop' => t('Delete Room'), '$drop' => t('Delete Room'),
'$away' => t('I am away right now'), '$away' => t('I am away right now'),
'$online' => t('I am online'), '$online' => t('I am online'),
'$feature_encrypt' => ((feature_enabled(local_channel(),'content_encrypt')) ? true : false), '$feature_encrypt' => ((Apps::system_app_installed(local_channel(),'Secrets')) ? true : false),
'$cipher' => $cipher, '$cipher' => $cipher,
'$linkurl' => t('Please enter a link URL:'), '$linkurl' => t('Please enter a link URL:'),
'$encrypt' => t('Encrypt text'), '$encrypt' => t('Encrypt text'),

View file

@ -0,0 +1,28 @@
<?php
namespace Zotlabs\Module;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Libsync;
use Zotlabs\Web\Controller;
class Secrets extends Controller {
function get() {
$desc = t('This app allows you to protect messages with a secret passphrase. This only works across selected platforms.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
if(! ( local_channel() && Apps::system_app_installed(local_channel(),'Secrets'))) {
return $text;
}
$desc = t('This app is installed. A button to encrypt content may be found in the post editor.');
$text = '<div class="section-content-info-wrapper">' . $desc . '</div>';
return $text;
}
}

6
app/secrets.apd Normal file
View file

@ -0,0 +1,6 @@
version: 1
url: $baseurl/secrets
requires: local_channel
name: Secrets
photo: icon:key
categories: Personal

View file

@ -1462,7 +1462,7 @@ function z_status_editor($a, $x, $popup = false) {
'$defpublish' => $defpublish, '$defpublish' => $defpublish,
'$feature_future' => $feature_future, '$feature_future' => $feature_future,
'$future_txt' => t('Set publish date'), '$future_txt' => t('Set publish date'),
'$feature_encrypt' => ((feature_enabled($x['profile_uid'], 'content_encrypt') && (! $webpage)) ? true : false), '$feature_encrypt' => ((Apps::system_app_installed($x['profile_uid'],'Secrets')) ? true : false),
'$encrypt' => t('Encrypt text'), '$encrypt' => t('Encrypt text'),
'$cipher' => $cipher, '$cipher' => $cipher,
'$expiryModalOK' => t('OK'), '$expiryModalOK' => t('OK'),