aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-07-26 18:00:00 +0000
committerMario <mario@mariovavti.com>2022-07-26 18:00:00 +0000
commit40377796edd8c612ce9d68f52fc146ad32302f9e (patch)
tree92cce4a3ee3627ed28f45ce8f0bb3598be87c8c9 /Zotlabs
parentc452a621fe7db5405d929ebc5f5433c9670fc367 (diff)
parentfedad7f31a1b9133bfd63de7fc19de6916485254 (diff)
downloadvolse-hubzilla-40377796edd8c612ce9d68f52fc146ad32302f9e.tar.gz
volse-hubzilla-40377796edd8c612ce9d68f52fc146ad32302f9e.tar.bz2
volse-hubzilla-40377796edd8c612ce9d68f52fc146ad32302f9e.zip
Merge branch '7.6RC'7.6
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Enotify.php2
-rw-r--r--Zotlabs/Lib/MessageFilter.php48
-rw-r--r--Zotlabs/Module/Hq.php20
-rw-r--r--Zotlabs/Module/Page.php85
-rw-r--r--Zotlabs/Render/Comanche.php12
-rw-r--r--Zotlabs/Widget/Channel_activities.php251
-rw-r--r--Zotlabs/Widget/Hq_controls.php25
-rw-r--r--Zotlabs/Widget/Messages.php2
-rw-r--r--Zotlabs/Widget/Notes.php2
9 files changed, 371 insertions, 76 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 59e4d9a4e..07c426960 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -860,7 +860,7 @@ class Enotify {
// convert this logic into a json array just like the system notifications
$who = (($item['verb'] === ACTIVITY_SHARE) ? 'owner' : 'author');
- $body = html2plain(bbcode($item['body'], ['drop_media']), 75, true);
+ $body = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($body) {
$body = htmlentities($body, ENT_QUOTES, 'UTF-8', false);
}
diff --git a/Zotlabs/Lib/MessageFilter.php b/Zotlabs/Lib/MessageFilter.php
index 70b0188c4..7d6dcbe8e 100644
--- a/Zotlabs/Lib/MessageFilter.php
+++ b/Zotlabs/Lib/MessageFilter.php
@@ -29,7 +29,19 @@ class MessageFilter {
if (! $word) {
continue;
}
- if (substr($word, 0, 1) === '#' && $tags) {
+ if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) {
+ if (!strlen($lang)) {
+ // Result is ambiguous. As we are matching deny rules only at this time, continue tests.
+ // Any matching deny rule concludes testing.
+ continue;
+ }
+ if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) {
+ return false;
+ } elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) {
+ return false;
+ }
+ }
+ elseif (substr($word, 0, 1) === '#' && $tags) {
foreach ($tags as $t) {
if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return false;
@@ -51,10 +63,6 @@ class MessageFilter {
}
} elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) {
return false;
- } elseif ((strpos($word, 'lang=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 5))) == 0)) {
- return false;
- } elseif ((strpos($word, 'lang!=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 6))) != 0)) {
- return false;
} elseif (stristr($text, $word) !== false) {
return false;
}
@@ -69,7 +77,19 @@ class MessageFilter {
if (! $word) {
continue;
}
- if (substr($word, 0, 1) === '#' && $tags) {
+ if (isset($lang) && ((strpos($word, 'lang=') === 0) || (strpos($word, 'lang!=') === 0))) {
+ if (!strlen($lang)) {
+ // Result is ambiguous. However we are checking allow rules
+ // and an ambiguous language is always permitted.
+ return true;
+ }
+ if (strpos($word, 'lang=') === 0 && strcasecmp($lang, trim(substr($word, 5))) == 0) {
+ return true;
+ } elseif (strpos($word, 'lang!=') === 0 && strcasecmp($lang, trim(substr($word, 6))) != 0) {
+ return true;
+ }
+ }
+ elseif (substr($word, 0, 1) === '#' && $tags) {
foreach ($tags as $t) {
if ((($t['ttype'] == TERM_HASHTAG) || ($t['ttype'] == TERM_COMMUNITYTAG)) && (($t['term'] === substr($word, 1)) || (substr($word, 1) === '*'))) {
return true;
@@ -91,10 +111,6 @@ class MessageFilter {
}
} elseif ((strpos($word, '/') === 0) && preg_match($word, $text)) {
return true;
- } elseif ((strpos($word, 'lang=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 5))) == 0)) {
- return true;
- } elseif ((strpos($word, 'lang!=') === 0) && ($lang) && (strcasecmp($lang, trim(substr($word, 6))) != 0)) {
- return true;
} elseif (stristr($text, $word) !== false) {
return true;
}
@@ -123,7 +139,8 @@ class MessageFilter {
* - ?foo {} baz which will check if 'baz' is an array element in item.foo
* - ?foo {*} baz which will check if 'baz' is an array key in item.foo
* - ?foo which will check for a return of a true condition for item.foo;
- *
+ * - ?!foo which will check for a return of a false condition for item.foo;
+ *
* The values 0, '', an empty array, and an unset value will all evaluate to false.
*
* @param string $s
@@ -205,6 +222,15 @@ class MessageFilter {
return false;
}
+ // Ordering of this check (for falsiness) with relation to the following one (check for truthiness) is important.
+ if (preg_match('/\!(.*?)$/', $s, $matches)) {
+ $x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
+ if (!$x) {
+ return true;
+ }
+ return false;
+ }
+
if (preg_match('/(.*?)$/', $s, $matches)) {
$x = ((array_key_exists(trim($matches[1]),$item)) ? $item[trim($matches[1])] : EMPTY_STR);
if ($x) {
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index 5001bbe62..efbfcf084 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -49,16 +49,16 @@ class Hq extends \Zotlabs\Web\Controller {
$sql_extra = '';
if(! $item_hash) {
- $r = q("SELECT mid FROM item
- WHERE uid = %d $item_normal
- AND mid = parent_mid
- AND item_private IN (0, 1)
- ORDER BY created DESC LIMIT 1",
- intval(local_channel())
- );
- if($r[0]['mid']) {
- $item_hash = $r[0]['mid'];
- }
+ //$r = q("SELECT mid FROM item
+ //WHERE uid = %d $item_normal
+ //AND mid = parent_mid
+ //AND item_private IN (0, 1)
+ //ORDER BY created DESC LIMIT 1",
+ //intval(local_channel())
+ //);
+ //if($r[0]['mid']) {
+ //$item_hash = $r[0]['mid'];
+ //}
}
if($item_hash) {
diff --git a/Zotlabs/Module/Page.php b/Zotlabs/Module/Page.php
index 5fdd32825..8a698005a 100644
--- a/Zotlabs/Module/Page.php
+++ b/Zotlabs/Module/Page.php
@@ -9,42 +9,42 @@ class Page extends \Zotlabs\Web\Controller {
function init() {
// We need this to make sure the channel theme is always loaded.
-
+
$which = argv(1);
$profile = 0;
profile_load($which,$profile);
-
-
-
+
+
+
if(\App::$profile['profile_uid'])
head_set_icon(\App::$profile['thumb']);
-
+
// load the item here in the init function because we need to extract
// the page layout and initialise the correct theme.
-
-
+
+
$observer = \App::get_observer();
$ob_hash = (($observer) ? $observer['xchan_hash'] : '');
-
-
- // perm_is_allowed is denied unconditionally when 'site blocked to unauthenticated members'.
+
+
+ // perm_is_allowed is denied unconditionally when 'site blocked to unauthenticated members'.
// This bypasses that restriction for sys channel (public) content
-
+
if((! perm_is_allowed(\App::$profile['profile_uid'],$ob_hash,'view_pages')) && (! is_sys_channel(\App::$profile['profile_uid']))) {
notice( t('Permission denied.') . EOL);
return;
}
-
+
if(argc() < 3) {
notice( t('Invalid item.') . EOL);
return;
}
-
+
$channel_address = argv(1);
-
+
// Always look first for the page name prefixed by the observer language; for instance page/nickname/de/foo
// followed by page/nickname/foo if that is not found.
- // If your browser language is de and you want to access the default in this case,
+ // If your browser language is de and you want to access the default in this case,
// use page/nickname/-/foo to over-ride the language and access only the page with pagelink of 'foo'
$page_name = '';
@@ -63,33 +63,33 @@ class Page extends \Zotlabs\Web\Controller {
// The page link title was stored in a urlencoded format
// php or the browser may/will have decoded it, so re-encode it for our search
-
+
$page_id = urlencode($page_name);
$lang_page_id = urlencode(\App::$language . '/' . $page_name);
$u = q("select channel_id from channel where channel_address = '%s' limit 1",
dbesc($channel_address)
);
-
+
if(! $u) {
notice( t('Channel not found.') . EOL);
return;
}
-
+
if($_REQUEST['rev'])
$revision = " and revision = " . intval($_REQUEST['rev']) . " ";
else
$revision = " order by revision desc ";
-
+
require_once('include/security.php');
$sql_options = item_permissions_sql($u[0]['channel_id']);
- $r = null;
+ $r = null;
if(! $ignore_language) {
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
- where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
- and iconfig.k = 'WEBPAGE' and item_type = %d
+ where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
+ and iconfig.k = 'WEBPAGE' and item_type = %d
$sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($lang_page_id),
@@ -98,8 +98,8 @@ class Page extends \Zotlabs\Web\Controller {
}
if(! $r) {
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
- where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
- and iconfig.k = 'WEBPAGE' and item_type = %d
+ where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
+ and iconfig.k = 'WEBPAGE' and item_type = %d
$sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
@@ -109,7 +109,7 @@ class Page extends \Zotlabs\Web\Controller {
if(! $r) {
// no webpage by that name, but we do allow you to load/preview a layout using this module. Try that.
$r = q("select item.* from item left join iconfig on item.id = iconfig.iid
- where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
+ where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
and iconfig.k = 'PDL' AND item_type = %d $sql_options $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
@@ -117,17 +117,17 @@ class Page extends \Zotlabs\Web\Controller {
);
}
if(! $r) {
-
+
// Check again with no permissions clause to see if it is a permissions issue
-
+
$x = q("select item.* from item left join iconfig on item.id = iconfig.iid
- where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
+ where item.uid = %d and iconfig.cat = 'system' and iconfig.v = '%s' and item.item_delayed = 0
and iconfig.k = 'WEBPAGE' and item_type = %d $revision limit 1",
intval($u[0]['channel_id']),
dbesc($page_id),
intval(ITEM_TYPE_WEBPAGE)
);
-
+
if($x) {
// Yes, it's there. You just aren't allowed to see it.
notice( t('Permission denied.') . EOL);
@@ -140,7 +140,7 @@ class Page extends \Zotlabs\Web\Controller {
if($r[0]['title'])
\App::$page['title'] = escape_tags($r[0]['title']);
-
+
if($r[0]['item_type'] == ITEM_TYPE_PDL) {
\App::$comanche = new \Zotlabs\Render\Comanche();
\App::$comanche->parse($r[0]['body']);
@@ -151,40 +151,41 @@ class Page extends \Zotlabs\Web\Controller {
dbesc($r[0]['layout_mid']),
intval($u[0]['channel_id'])
);
-
+
if($l) {
\App::$comanche = new \Zotlabs\Render\Comanche();
\App::$comanche->parse($l[0]['body']);
\App::$pdl = $l[0]['body'];
}
}
-
+
\App::$data['webpage'] = $r;
-
+
}
-
+
function get() {
-
+
$r = \App::$data['webpage'];
+
if(! $r)
return;
-
+
if($r[0]['item_type'] == ITEM_TYPE_PDL) {
$r[0]['body'] = t('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.');
$r[0]['mimetype'] = 'text/plain';
$r[0]['title'] = '';
-
+
}
-
+
xchan_query($r);
$r = fetch_post_tags($r,true);
-
+
if($r[0]['mimetype'] === 'application/x-pdl')
\App::$page['pdl_content'] = true;
-
+
$o .= prepare_page($r[0]);
return $o;
-
+
}
-
+
}
diff --git a/Zotlabs/Render/Comanche.php b/Zotlabs/Render/Comanche.php
index 230c2455e..7288c7fd7 100644
--- a/Zotlabs/Render/Comanche.php
+++ b/Zotlabs/Render/Comanche.php
@@ -219,7 +219,8 @@ class Comanche {
* - [if $config.system.foo {} baz] which will check if 'baz' is an array element in get_config('system','foo')
* - [if $config.system.foo {*} baz] which will check if 'baz' is an array key in get_config('system','foo')
* - [if $config.system.foo] which will check for a return of a true condition for get_config('system','foo');
- *
+ * - [if !$config.system.foo] which will check for a return of a false condition for get_config('system','foo');
+ *
* The values 0, '', an empty array, and an unset value will all evaluate to false.
*
* @param int|string $s
@@ -299,6 +300,15 @@ class Comanche {
return false;
}
+ // Ordering of this check (for falsiness) with relation to the following one (check for truthiness) is important.
+ if (preg_match('/[\!\$](.*?)$/', $s, $matches)) {
+ $x = $this->get_condition_var($matches[1]);
+ if (!$x) {
+ return true;
+ }
+ return false;
+ }
+
if(preg_match('/[\$](.*?)$/',$s,$matches)) {
$x = $this->get_condition_var($matches[1]);
if($x)
diff --git a/Zotlabs/Widget/Channel_activities.php b/Zotlabs/Widget/Channel_activities.php
new file mode 100644
index 000000000..d12d80a8c
--- /dev/null
+++ b/Zotlabs/Widget/Channel_activities.php
@@ -0,0 +1,251 @@
+<?php
+
+/**
+ * * Name: Channel Activity
+ * * Description: A widget that shows you a greeting and info about your last login and other channel activities
+ */
+
+namespace Zotlabs\Widget;
+
+use App;
+use Zotlabs\Lib\Apps;
+
+class Channel_activities {
+
+ public static $activities = [];
+ public static $uid = null;
+ public static $limit = 3;
+ public static $channel = [];
+
+ public static function widget($arr) {
+ if (!local_channel()) {
+ return EMPTY_STR;
+ }
+
+ self::$uid = local_channel();
+ self::$channel = App::get_channel();
+
+ $o .= '<div id="channel-activities" class="d-none overflow-hidden">';
+ $o .= '<h2 class="mb-4">Welcome ' . self::$channel['channel_name'] . '!</h2>';
+ //$o .= 'Last login date: ' . get_pconfig(self::$uid, 'system', 'stored_login_date') . ' from ' . get_pconfig(self::$uid, 'system', 'stored_login_addr');
+
+ self::get_photos_activity();
+ self::get_files_activity();
+ self::get_webpages_activity();
+ self::get_channels_activity();
+
+ $hookdata = [
+ 'channel' => self::$channel,
+ 'activities' => self::$activities,
+ 'limit' => self::$limit
+ ];
+
+ call_hooks('channel_activities_widget', $hookdata);
+
+ if (!$hookdata['activities']) {
+ $o .= '<h3>No recent activity to display</h3>';
+ return $o;
+ }
+
+ $keys = array_column($hookdata['activities'], 'date');
+
+ array_multisort($keys, SORT_DESC, $hookdata['activities']);
+
+ // hz_syslog('activities: ' . print_r($hookdata['activities'], true));
+
+ foreach($hookdata['activities'] as $a) {
+ $o .= replace_macros(get_markup_template($a['tpl']), [
+ '$url' => $a['url'],
+ '$icon' => $a['icon'],
+ '$label' => $a['label'],
+ '$items' => $a['items']
+ ]);
+ }
+
+ $o .= '</div>';
+
+ return $o;
+ }
+
+ private static function get_photos_activity() {
+
+ $r = q("SELECT edited, height, width, imgscale, description, filename, resource_id FROM photo WHERE uid = %d
+ AND photo_usage = 0 AND is_nsfw = 0 AND imgscale = 3
+ ORDER BY edited DESC LIMIT 6",
+ intval(self::$uid)
+ );
+
+ if (!$r) {
+ return;
+ }
+
+ foreach($r as $rr) {
+ $i[] = [
+ 'url' => z_root() . '/photos/' . self::$channel['channel_address'] . '/image/' . $rr['resource_id'],
+ 'edited' => datetime_convert('UTC', date_default_timezone_get(), $rr['edited']),
+ 'width' => $rr['width'],
+ 'height' => $rr['height'],
+ 'alt' => (($rr['description']) ? $rr['description'] : $rr['filename']),
+ 'src' => z_root() . '/photo/' . $rr['resource_id'] . '-' . $rr['imgscale']
+ ];
+ }
+
+ self::$activities['photos'] = [
+ 'label' => t('Photos'),
+ 'icon' => 'photo',
+ 'url' => z_root() . '/photos/' . self::$channel['channel_address'],
+ 'date' => $r[0]['edited'],
+ 'items' => $i,
+ 'tpl' => 'channel_activities_photos.tpl'
+ ];
+
+ }
+
+ private static function get_files_activity() {
+
+ $r = q("SELECT * FROM attach WHERE uid = %d
+ AND is_dir = 0 AND is_photo = 0
+ ORDER BY edited DESC LIMIT %d",
+ intval(self::$uid),
+ intval(self::$limit)
+ );
+
+ if (!$r) {
+ return;
+ }
+
+ foreach($r as $rr) {
+ $i[] = [
+ 'url' => z_root() . '/cloud/' . self::$channel['channel_address'] . '/' . rtrim($rr['display_path'], $rr['filename']) . '#' . $rr['id'],
+ 'summary' => $rr['filename'],
+ 'footer' => datetime_convert('UTC', date_default_timezone_get(), $rr['edited'])
+ ];
+ }
+
+ self::$activities['files'] = [
+ 'label' => t('Files'),
+ 'icon' => 'folder-open',
+ 'url' => z_root() . '/cloud/' . self::$channel['channel_address'],
+ 'date' => $r[0]['edited'],
+ 'items' => $i,
+ 'tpl' => 'channel_activities.tpl'
+ ];
+
+ }
+
+ private static function get_webpages_activity() {
+
+ if(!Apps::system_app_installed(self::$uid, 'Webpages')) {
+ return;
+ }
+
+ $r = q("SELECT * FROM iconfig LEFT JOIN item ON iconfig.iid = item.id WHERE item.uid = %d
+ AND iconfig.cat = 'system' AND iconfig.k = 'WEBPAGE' AND item_type = %d
+ ORDER BY item.edited DESC LIMIT %d",
+ intval(self::$uid),
+ intval(ITEM_TYPE_WEBPAGE),
+ intval(self::$limit)
+ );
+
+ if (!$r) {
+ return;
+ }
+
+ foreach($r as $rr) {
+ $summary = html2plain(purify_html(bbcode($rr['body'], ['drop_media' => true, 'tryoembed' => false])), 85, true);
+ if ($summary) {
+ $summary = substr_words(htmlentities($summary, ENT_QUOTES, 'UTF-8', false), 85);
+ }
+
+ $i[] = [
+ 'url' => z_root() . '/page/' . self::$channel['channel_address'] . '/' . $rr['v'],
+ 'title' => $rr['title'],
+ 'summary' => $summary,
+ 'footer' => datetime_convert('UTC', date_default_timezone_get(), $rr['edited'])
+ ];
+ }
+
+ self::$activities['webpages'] = [
+ 'label' => t('Webpages'),
+ 'icon' => 'newspaper-o',
+ 'url' => z_root() . '/webpages/' . self::$channel['channel_address'],
+ 'date' => $r[0]['edited'],
+ 'items' => $i,
+ 'tpl' => 'channel_activities.tpl'
+ ];
+
+ }
+
+ private static function get_channels_activity() {
+
+ $account = App::get_account();
+
+ $r = q("SELECT channel_id, channel_name, xchan_photo_s FROM channel
+ LEFT JOIN xchan ON channel_hash = xchan_hash
+ WHERE channel_account_id = %d
+ AND channel_id != %d AND channel_removed = 0",
+ intval($account['account_id']),
+ intval(self::$uid)
+ );
+
+ if (!$r) {
+ return;
+ }
+
+ $channels_activity = 0;
+
+ foreach($r as$rr) {
+
+ $intros = q("SELECT COUNT(abook_id) AS total FROM abook WHERE abook_channel = %d
+ AND abook_pending = 1 AND abook_self = 0 AND abook_ignored = 0",
+ intval($rr['channel_id'])
+ );
+
+ $notices = q("SELECT COUNT(id) AS total FROM notify WHERE uid = %d AND seen = 0",
+ intval($rr['channel_id'])
+ );
+
+ if (!$intros[0]['total'] && !$notices[0]['total']) {
+ continue;
+ }
+
+ $footer = '';
+
+ if ($intros[0]['total']) {
+ $footer .= intval($intros[0]['total']) . ' ' . tt('new connection', 'new connections', intval($intros[0]['total']), 'noun');
+ if ($notices[0]['total']) {
+ $footer .= ', ';
+ }
+ }
+ if ($notices[0]['total']) {
+ $footer .= intval($notices[0]['total']) . ' ' . tt('notice', 'notices', intval($notices[0]['total']), 'noun');
+ }
+
+ $i[] = [
+ 'url' => z_root() . '/manage/' . $rr['channel_id'],
+ 'title' => '',
+ 'summary' => '<img src="' . $rr['xchan_photo_s'] . '" class="menu-img-2">' . $rr['channel_name'],
+ 'footer' => $footer
+ ];
+
+ $channels_activity++;
+
+ }
+
+ if(!$channels_activity) {
+ return;
+ }
+
+ self::$activities['channels'] = [
+ 'label' => t('Channels'),
+ 'icon' => 'home',
+ 'url' => z_root() . '/manage',
+ 'date' => datetime_convert(),
+ 'items' => $i,
+ 'tpl' => 'channel_activities.tpl'
+ ];
+
+ }
+
+}
+
diff --git a/Zotlabs/Widget/Hq_controls.php b/Zotlabs/Widget/Hq_controls.php
index 7b1fe817d..51212d145 100644
--- a/Zotlabs/Widget/Hq_controls.php
+++ b/Zotlabs/Widget/Hq_controls.php
@@ -19,15 +19,13 @@ class Hq_controls {
if (! local_channel())
return;
- $entries = [
- 'toggle_editor' => [
- 'label' => t('Toggle post editor'),
- 'href' => '#',
- 'class' => 'btn jot-toggle',
- 'type' => 'button',
- 'icon' => 'pencil',
- 'extra' => 'data-toggle="button"'
- ]
+ $entries['toggle_editor'] = [
+ 'label' => t('Toggle post editor'),
+ 'href' => '#',
+ 'class' => 'btn jot-toggle',
+ 'type' => 'button',
+ 'icon' => 'pencil',
+ 'extra' => 'data-toggle="button"'
];
if(Apps::system_app_installed(local_channel(), 'Notes')) {
@@ -41,6 +39,15 @@ class Hq_controls {
];
}
+ $entries['toggle_channel_activities'] = [
+ 'label' => t('Channel activities'),
+ 'href' => '#',
+ 'class' => 'btn channel-activities-toggle d-none',
+ 'type' => 'button',
+ 'icon' => 'user-circle-o',
+ 'extra' => 'data-toggle="button"'
+ ];
+
return replace_macros(get_markup_template('hq_controls.tpl'),
[
'$entries' => $entries,
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php
index d045ae85b..3d9ed8955 100644
--- a/Zotlabs/Widget/Messages.php
+++ b/Zotlabs/Widget/Messages.php
@@ -113,7 +113,7 @@ class Messages {
}
if (!$summary) {
- $summary = html2plain(bbcode($item['body'], ['drop_media' => true]), 75, true);
+ $summary = html2plain(bbcode($item['body'], ['drop_media' => true, 'tryoembed' => false]), 75, true);
if ($summary) {
$summary = htmlentities($summary, ENT_QUOTES, 'UTF-8', false);
}
diff --git a/Zotlabs/Widget/Notes.php b/Zotlabs/Widget/Notes.php
index c9d08c6b7..836159edd 100644
--- a/Zotlabs/Widget/Notes.php
+++ b/Zotlabs/Widget/Notes.php
@@ -31,7 +31,7 @@ class Notes {
$o = replace_macros($tpl, array(
'$text' => $text,
- '$html' => bbcode($text),
+ '$html' => bbcode($text, ['tryoembed' => false]),
'$app' => ((isset($arr['app'])) ? true : false),
'$hidden' => ((isset($arr['hidden'])) ? true : false),
'$strings' => [