aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-23 06:52:18 +0000
committerMario <mario@mariovavti.com>2020-10-23 06:52:18 +0000
commit69d627a58bee8eb9922fd68211982d12c1f7cb75 (patch)
treeebe8c0fe95d4287b8ea7487481344dd295e6ec92
parentc1f36802a14c027b580a79ef5e6b85f08a4a918f (diff)
parent2772c335635aa5248a4509e0976432707b3e716e (diff)
downloadvolse-hubzilla-69d627a58bee8eb9922fd68211982d12c1f7cb75.tar.gz
volse-hubzilla-69d627a58bee8eb9922fd68211982d12c1f7cb75.tar.bz2
volse-hubzilla-69d627a58bee8eb9922fd68211982d12c1f7cb75.zip
Merge branch 'dev' into 5.0RC
-rw-r--r--Zotlabs/Daemon/Notifier.php58
-rw-r--r--Zotlabs/Lib/Enotify.php4
-rw-r--r--Zotlabs/Lib/Libzot.php12
-rw-r--r--Zotlabs/Module/Channel.php40
-rw-r--r--Zotlabs/Module/Display.php14
-rw-r--r--Zotlabs/Module/Hq.php17
-rw-r--r--Zotlabs/Module/Network.php58
-rw-r--r--Zotlabs/Module/Pubstream.php1
-rw-r--r--Zotlabs/Module/Sse_bs.php39
-rwxr-xr-xboot.php2
-rw-r--r--include/acl_selectors.php47
-rw-r--r--include/bbcode.php14
-rw-r--r--include/hubloc.php8
-rw-r--r--include/text.php38
-rw-r--r--include/xchan.php4
-rw-r--r--include/zot.php2
-rw-r--r--view/css/bootstrap-red.css27
-rw-r--r--view/js/acl.js74
-rw-r--r--view/js/autocomplete.js2
-rw-r--r--view/js/main.js84
-rw-r--r--view/theme/redbasic/css/style.css2
-rwxr-xr-xview/tpl/acl_selector.tpl12
-rwxr-xr-xview/tpl/connection_template.tpl2
-rwxr-xr-xview/tpl/contact_template.tpl2
-rwxr-xr-xview/tpl/conv_item.tpl2
-rwxr-xr-xview/tpl/conv_list.tpl2
-rwxr-xr-xview/tpl/direntry.tpl2
-rwxr-xr-xview/tpl/jot.tpl2
-rwxr-xr-xview/tpl/micropro_img.tpl2
-rw-r--r--view/tpl/notifications_widget.tpl18
-rwxr-xr-xview/tpl/photo_top.tpl2
-rwxr-xr-xview/tpl/search_item.tpl2
32 files changed, 346 insertions, 249 deletions
diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php
index a29fc6101..8ea75af61 100644
--- a/Zotlabs/Daemon/Notifier.php
+++ b/Zotlabs/Daemon/Notifier.php
@@ -563,17 +563,40 @@ class Notifier {
// Now we have collected recipients (except for external mentions, FIXME)
// Let's reduce this to a set of hubs; checking that the site is not dead.
- $r = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project from hubloc left join site on site_url = hubloc_url where hubloc_hash in (" . protect_sprintf(implode(',',$recipients)) . ")
- and hubloc_error = 0 and hubloc_deleted = 0 and ( site_dead = 0 OR site_dead is null ) "
+ $hubs = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project, site.site_dead from hubloc left join site on site_url = hubloc_url
+ where hubloc_hash in (" . protect_sprintf(implode(',',$recipients)) . ")
+ and hubloc_error = 0 and hubloc_deleted = 0"
);
+
+ // public posts won't make it to the local public stream unless there's a recipient on this site.
+ // This code block sees if it's a public post and localhost is missing, and if so adds an entry for the local sys channel to the $hubs list
+
+ if (! $private) {
+ $found_localhost = false;
+ if ($hubs) {
+ foreach ($hubs as $h) {
+ if ($h['hubloc_url'] === z_root()) {
+ $found_localhost = true;
+ break;
+ }
+ }
+ }
+ if (! $found_localhost) {
+ $localhub = q("select hubloc.*, site.site_crypto, site.site_flags, site.site_version, site.site_project, site.site_dead from hubloc
+ left join site on site_url = hubloc_url where hubloc_id_url = '%s' and hubloc_error = 0 and hubloc_deleted = 0",
+ dbesc(z_root() . '/channel/sys')
+ );
+ if ($localhub) {
+ $hubs = array_merge($hubs, $localhub);
+ }
+ }
+ }
- if(! $r) {
+ if(! $hubs) {
logger('notifier: no hubs', LOGGER_NORMAL, LOG_NOTICE);
return;
}
- $hubs = $r;
-
/**
* Reduce the hubs to those that are unique. For zot hubs, we need to verify uniqueness by the sitekey,
* since it may have been a re-install which has not yet been detected and pruned.
@@ -586,8 +609,15 @@ class Notifier {
$keys = []; // array of keys to check uniquness for zot hubs
$urls = []; // array of urls to check uniqueness of hubs from other networks
$hub_env = []; // per-hub envelope so we don't broadcast the entire envelope to all
+ $dead = []; // known dead hubs - report them as undeliverable
foreach($hubs as $hub) {
+
+ if (intval($hub['site_dead'])) {
+ $dead[] = $hub;
+ continue;
+ }
+
if($env_recips) {
foreach($env_recips as $er) {
if($hub['hubloc_hash'] === $er['hash']) {
@@ -814,6 +844,24 @@ class Notifier {
logger('notifier: basic loop complete.', LOGGER_DEBUG);
+ if ($dead) {
+ foreach ($dead as $deceased) {
+ if (is_array($target_item) && (! $target_item['item_deleted']) && (! get_config('system','disable_dreport'))) {
+ q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_name, dreport_result, dreport_time, dreport_xchan, dreport_queue )
+ values ( '%s', '%s','%s','%s','%s','%s','%s','%s' ) ",
+ dbesc($target_item['mid']),
+ dbesc($deceased['hubloc_host']),
+ dbesc($deceased['hubloc_host']),
+ dbesc($deceased['hubloc_host']),
+ dbesc('undeliverable/unresponsive site'),
+ dbesc(datetime_convert()),
+ dbesc($channel['channel_hash']),
+ dbesc(random_string(48))
+ );
+ }
+ }
+ }
+
call_hooks('notifier_end',$target_item);
logger('notifer: complete.');
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 03a824b9b..c78325ee3 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -966,8 +966,8 @@ class Enotify {
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => $when,
- 'hclass' => ('notify-unseen'),
- 'message' => t('posted an event')
+ 'hclass' => (($today) ? 'notify-unseen bg-warning' : 'notify-unseen'),
+ 'message' => t('created an event')
];
return $x;
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 44f1f399e..f0fe3ab24 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -326,14 +326,10 @@ class Libzot {
if($permissions && is_array($permissions)) {
$old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream');
- // We need to reset their_perms prior to setting the new ones.
- // Otherwise withdrawn permissions will not take effect locally.
- q("DELETE FROM abconfig WHERE chan = %d AND xchan = '%s' AND cat = 'their_perms'",
- intval($channel['channel_id']),
- dbesc($x['hash'])
- );
- foreach($permissions as $p) {
- set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$p,'1');
+ $permissions = Permissions::FilledPerms($permissions);
+
+ foreach($permissions as $k => $v) {
+ set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$k,$v);
}
}
diff --git a/Zotlabs/Module/Channel.php b/Zotlabs/Module/Channel.php
index 9c8cddab3..307be048a 100644
--- a/Zotlabs/Module/Channel.php
+++ b/Zotlabs/Module/Channel.php
@@ -442,44 +442,12 @@ class Channel extends Controller {
}
- $update_unseen = '';
-
- if($page_mode === 'list') {
-
- /**
- * in "list mode", only mark the parent item and any like activities as "seen".
- * We won't distinguish between comment likes and post likes. The important thing
- * is that the number of unseen comments will be accurate. The SQL to separate the
- * comment likes could also get somewhat hairy.
- */
-
- if($parents_str) {
- $update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
- $update_unseen .= " OR ( parent IN ( " . dbesc($parents_str) . " ) AND verb in ( '" . dbesc(ACTIVITY_LIKE) . "','" . dbesc(ACTIVITY_DISLIKE) . "' ))) ";
- }
- }
- else {
- if($parents_str) {
- $update_unseen = " AND parent IN ( " . dbesc($parents_str) . " )";
- }
- }
-
- if($is_owner && $update_unseen) {
- $x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
- call_hooks('update_unseen',$x);
- if($x['update'] === 'unset' || intval($x['update'])) {
- $r = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 and item_wall = 1 AND uid = %d $update_unseen",
- intval(local_channel())
- );
- }
- }
-
// Add pinned content
if(! x($_REQUEST,'mid') && ! $search) {
- $pinned = new \Zotlabs\Widget\Pinned;
- $r = $pinned->widget(intval(App::$profile['profile_uid']), [ITEM_TYPE_POST]);
- $o .= $r['html'];
- }
+ $pinned = new \Zotlabs\Widget\Pinned;
+ $r = $pinned->widget(intval(App::$profile['profile_uid']), [ITEM_TYPE_POST]);
+ $o .= $r['html'];
+ }
$mode = (($search) ? 'search' : 'channel');
diff --git a/Zotlabs/Module/Display.php b/Zotlabs/Module/Display.php
index f45f37001..3d61d7018 100644
--- a/Zotlabs/Module/Display.php
+++ b/Zotlabs/Module/Display.php
@@ -47,7 +47,6 @@ class Display extends \Zotlabs\Web\Controller {
}
$observer_is_owner = false;
- $updateable = false;
if(local_channel() && (! $update)) {
@@ -274,9 +273,6 @@ class Display extends \Zotlabs\Web\Controller {
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
- if($r) {
- $updateable = true;
- }
}
if(! $r) {
@@ -318,9 +314,6 @@ class Display extends \Zotlabs\Web\Controller {
intval(local_channel()),
dbesc($target_item['parent_mid'])
);
- if($r) {
- $updateable = true;
- }
}
if($r === null) {
@@ -432,13 +425,6 @@ class Display extends \Zotlabs\Web\Controller {
killme();
}
-
- if($updateable) {
- $x = q("UPDATE item SET item_unseen = 0 where item_unseen = 1 AND uid = %d and parent = %d ",
- intval(local_channel()),
- intval($r[0]['item_id'])
- );
- }
$o .= '<div id="content-complete"></div>';
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index 5b331f4c1..e2678c07f 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -199,8 +199,6 @@ class Hq extends \Zotlabs\Web\Controller {
]);
}
- $updateable = false;
-
if($load && $target_item) {
$r = null;
@@ -213,10 +211,6 @@ class Hq extends \Zotlabs\Web\Controller {
dbesc($target_item['parent_mid'])
);
- if($r) {
- $updateable = true;
- }
-
if(!$r) {
$sys_item = true;
@@ -243,10 +237,6 @@ class Hq extends \Zotlabs\Web\Controller {
dbesc($target_item['parent_mid'])
);
- if($r) {
- $updateable = true;
- }
-
if(!$r) {
$sys_item = true;
@@ -283,13 +273,6 @@ class Hq extends \Zotlabs\Web\Controller {
$o .= conversation($items, 'hq', $update, 'client');
- if($updateable) {
- $x = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d AND parent = %d ",
- intval(local_channel()),
- intval($r[0]['item_id'])
- );
- }
-
$o .= '<div id="content-complete"></div>';
return $o;
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index fe1aa4386..bbacbb21e 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -133,8 +133,6 @@ class Network extends \Zotlabs\Web\Controller {
$pf = ((x($_GET,'pf')) ? $_GET['pf'] : '');
$unseen = ((x($_GET,'unseen')) ? $_GET['unseen'] : '');
- $deftag = '';
-
if (Apps::system_app_installed(local_channel(),'Affinity Tool')) {
$affinity_locked = intval(get_pconfig(local_channel(),'affinity','lock',1));
if ($affinity_locked) {
@@ -160,10 +158,7 @@ class Network extends \Zotlabs\Web\Controller {
goaway(z_root() . '/network');
// NOTREACHED
}
- if($pf)
- $deftag = '!{' . (($cid_r[0]['xchan_addr']) ? $cid_r[0]['xchan_addr'] : $cid_r[0]['xchan_url']) . '}';
- else
- $def_acl = [ 'allow_cid' => '<' . $cid_r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
+ $def_acl = [ 'allow_cid' => '<' . $cid_r[0]['abook_xchan'] . '>', 'allow_gid' => '', 'deny_cid' => '', 'deny_gid' => '' ];
}
if(! $update) {
@@ -177,6 +172,17 @@ class Network extends \Zotlabs\Web\Controller {
nav_set_selected('Network');
+ $bang = '!';
+
+ if($cid_r) {
+ $forums = get_forum_channels($channel['channel_id']);
+ if($forums) {
+ $forum_xchans = ids_to_array($forums, 'xchan_hash');
+ if(in_array($cid_r[0]['abook_xchan'], $forum_xchans))
+ $bang = $cid_r[0]['abook_xchan'];
+ }
+ }
+
$channel_acl = array(
'allow_cid' => $channel['channel_allow_cid'],
'allow_gid' => $channel['channel_allow_gid'],
@@ -184,7 +190,7 @@ class Network extends \Zotlabs\Web\Controller {
'deny_gid' => $channel['channel_deny_gid']
);
- $private_editing = ((($group || $cid) && (! intval($_GET['pf']))) ? true : false);
+ $private_editing = (($group || $cid) ? true : false);
$x = array(
'is_owner' => true,
@@ -194,7 +200,7 @@ class Network extends \Zotlabs\Web\Controller {
'lockstate' => (($private_editing || $channel['channel_allow_cid'] || $channel['channel_allow_gid'] || $channel['channel_deny_cid'] || $channel['channel_deny_gid']) ? 'lock' : 'unlock'),
'acl' => populate_acl((($private_editing) ? $def_acl : $channel_acl), true, \Zotlabs\Lib\PermissionDescription::fromGlobalPermission('view_stream'), get_post_aclDialogDescription(), 'acl_dialog_post'),
'permissions' => (($private_editing) ? $def_acl : $channel_acl),
- 'bang' => (($private_editing) ? '!' : ''),
+ 'bang' => (($private_editing) ? $bang : ''),
'visitor' => true,
'profile_uid' => local_channel(),
'editor_autocomplete' => true,
@@ -203,9 +209,6 @@ class Network extends \Zotlabs\Web\Controller {
'jotnets' => true,
'reset' => t('Reset form')
);
- if($deftag)
- $x['pretext'] = $deftag;
-
$status_editor = status_editor($a,$x,false,'Network');
$o .= $status_editor;
@@ -490,7 +493,6 @@ class Network extends \Zotlabs\Web\Controller {
$page_mode = 'client';
$parents_str = '';
- $update_unseen = '';
$simple_update = (($update) ? " and item_unseen = 1 " : '');
@@ -529,9 +531,6 @@ class Network extends \Zotlabs\Web\Controller {
);
$parents_str = ids_to_querystr($items,'item_id');
- if($parents_str) {
- $update_unseen = " AND id IN ( " . dbesc($parents_str) . " )";
- }
require_once('include/items.php');
@@ -595,35 +594,6 @@ class Network extends \Zotlabs\Web\Controller {
$items = array();
}
- if($page_mode === 'list') {
-
- /**
- * in "list mode", only mark the parent item and any like activities as "seen".
- * We won't distinguish between comment likes and post likes. The important thing
- * is that the number of unseen comments will be accurate. The SQL to separate the
- * comment likes could also get somewhat hairy.
- */
-
- if($parents_str) {
- $update_unseen = " AND ( id IN ( " . dbesc($parents_str) . " )";
- $update_unseen .= " OR ( parent IN ( " . dbesc($parents_str) . " ) AND verb in ( '" . dbesc(ACTIVITY_LIKE) . "','" . dbesc(ACTIVITY_DISLIKE) . "' ))) ";
- }
- }
- else {
- if($parents_str) {
- $update_unseen = " AND parent IN ( " . dbesc($parents_str) . " )";
- }
- }
- }
-
- if($update_unseen) {
- $x = [ 'channel_id' => local_channel(), 'update' => 'unset' ];
- call_hooks('update_unseen',$x);
- if($x['update'] === 'unset' || intval($x['update'])) {
- $r = q("UPDATE item SET item_unseen = 0 WHERE item_unseen = 1 AND uid = %d $update_unseen ",
- intval(local_channel())
- );
- }
}
$mode = (($nouveau) ? 'network-new' : 'network');
diff --git a/Zotlabs/Module/Pubstream.php b/Zotlabs/Module/Pubstream.php
index 76a3e0d9e..55c96b23d 100644
--- a/Zotlabs/Module/Pubstream.php
+++ b/Zotlabs/Module/Pubstream.php
@@ -264,7 +264,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
// Then fetch all the children of the parents that are on this page
$parents_str = '';
- $update_unseen = '';
if($r) {
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index 6d5acf276..e3439e7dd 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -36,12 +36,15 @@ class Sse_bs extends Controller {
self::$vnotify = get_pconfig(self::$uid, 'system', 'vnotify', -1);
self::$evdays = intval(get_pconfig(self::$uid, 'system', 'evdays'));
- self::$limit = 100;
+ self::$limit = 50;
self::$offset = 0;
self::$xchans = '';
- if(!empty($_GET['nquery']) && $_GET['nquery'] !== '%') {
- $nquery = $_GET['nquery'];
+ if($_REQUEST['sse_rmids'])
+ self::mark_read($_REQUEST['sse_rmids']);
+
+ if(!empty($_REQUEST['nquery']) && $_REQUEST['nquery'] !== '%') {
+ $nquery = $_REQUEST['nquery'];
$x = q("SELECT xchan_hash FROM xchan WHERE xchan_name LIKE '%s' OR xchan_addr LIKE '%s'",
dbesc($nquery . '%'),
@@ -108,6 +111,31 @@ class Sse_bs extends Controller {
json_return_and_die($result);
}
+ function mark_read($arr) {
+
+ if(! self::$uid)
+ return;
+
+ $mids = [];
+ $str = '';
+
+ foreach($arr as $a) {
+ $mids[] = '\'' . dbesc(@base64url_decode(substr($a,4))) . '\'';
+ }
+
+ $str = implode($mids, ',');
+
+ $x = [ 'channel_id' => self::$uid, 'update' => 'unset' ];
+ call_hooks('update_unseen',$x);
+
+ if($x['update'] === 'unset' || intval($x['update'])) {
+ q("UPDATE item SET item_unseen = 0 WHERE uid = %d AND mid in (". $str . ") AND item_unseen = 1",
+ intval(self::$uid)
+ );
+ }
+
+ }
+
function bs_network($notifications) {
$result['network']['notifications'] = [];
@@ -163,9 +191,10 @@ class Sse_bs extends Controller {
$r = q("SELECT count(id) as total FROM item
WHERE uid = %d and item_unseen = 1 AND item_wall = 0 AND item_private IN (0, 1)
+ AND obj_type NOT IN ('Document', 'Video', 'Audio', 'Image')
+ AND author_xchan != '%s'
$item_normal
- $sql_extra
- AND author_xchan != '%s'",
+ $sql_extra",
intval(self::$uid),
dbesc(self::$ob_hash)
);
diff --git a/boot.php b/boot.php
index bbc359b3e..be23ae958 100755
--- a/boot.php
+++ b/boot.php
@@ -50,7 +50,7 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
-define ( 'STD_VERSION', '5.0RC6' );
+define ( 'STD_VERSION', '5.0RC7' );
define ( 'ZOT_REVISION', '6.0' );
define ( 'DB_UPDATE_VERSION', 1238 );
diff --git a/include/acl_selectors.php b/include/acl_selectors.php
index 35e385058..a3476439a 100644
--- a/include/acl_selectors.php
+++ b/include/acl_selectors.php
@@ -79,24 +79,44 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti
$custom = false;
}
- $r = q("SELECT id, profile_guid, profile_name from profile where is_default = 0 and uid = %d order by profile_name",
+ $r = q("SELECT id, hash, gname FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
intval(local_channel())
);
+
if($r) {
- foreach($r as $rv) {
- $selected = (($single_group && 'vp.' . $rv['profile_guid'] === $allow_gid[0]) ? ' selected = "selected" ' : '');
- $groups .= '<option id="' . 'vp' . $rv['id'] . '" value="' . 'vp.' . $rv['profile_guid'] . '"' . $selected . '>' . t('Profile','acl') . ' ' . $rv['profile_name'] . '</option>' . "\r\n";
+ $groups .= '<optgroup label = "' . t('Privacy Groups').'">';
+ foreach($r as $rr) {
+ $selected = (($single_group && $rr['hash'] === $allow_gid[0]) ? ' selected = "selected" ' : '');
+ $groups .= '<option id="' . $rr['id'] . '" value="' . $rr['hash'] . '"' . $selected . '>' . $rr['gname'] . '</option>' . "\r\n";
}
+ $groups .= '</optgroup>';
}
- $r = q("SELECT id, hash, gname FROM pgrp WHERE deleted = 0 AND uid = %d ORDER BY gname ASC",
+ $r = q("SELECT id, profile_guid, profile_name from profile where is_default = 0 and uid = %d order by profile_name",
intval(local_channel())
);
if($r) {
- foreach($r as $rr) {
- $selected = (($single_group && $rr['hash'] === $allow_gid[0]) ? ' selected = "selected" ' : '');
- $groups .= '<option id="' . $rr['id'] . '" value="' . $rr['hash'] . '"' . $selected . '>' . $rr['gname'] . '</option>' . "\r\n";
+ $groups .= '<optgroup label = "' . t('Profile-Based Privacy Groups').'">';
+ foreach($r as $rv) {
+ $selected = (($single_group && 'vp.' . $rv['profile_guid'] === $allow_gid[0]) ? ' selected = "selected" ' : '');
+ $groups .= '<option id="' . 'vp' . $rv['id'] . '" value="' . 'vp.' . $rv['profile_guid'] . '"' . $selected . '>' . $rv['profile_name'] . '</option>' . "\r\n";
+ }
+ $groups .= '</optgroup>';
+ }
+
+ // $dialog_description is only set in places where we set permissions for a post.
+ // Abuse this fact to decide if forums should be displayed or not.
+ if($dialog_description) {
+ $forums = get_forum_channels(local_channel(),1);
+ if($forums) {
+ $groups .= '<optgroup label = "' . t('Forums').'">';
+ foreach($forums as $f) {
+ $private = (($f['private_forum']) ? ' (' . t('Private Forum') . ')' : '');
+ $selected = (($single_group && $f['hash'] === $allow_cid[0]) ? ' selected = "selected" ' : '');
+ $groups .= '<option id="^' . $f['abook_id'] . '" value="^' . $f['xchan_hash'] . '"' . $selected . '>' . $f['xchan_name'] . $private . '</option>' . "\r\n";
+ }
+ $groups .= '</optgroup>';
}
}
@@ -104,17 +124,18 @@ function populate_acl($defaults = null,$show_jotnets = true, $emptyACL_descripti
$o = replace_macros($tpl, array(
'$showall' => $showall_caption,
'$onlyme' => t('Only me'),
- '$groups' => $groups,
+ '$groups' => $groups,
'$public_selected' => (($has_acl) ? false : true),
'$justme_selected' => $just_me,
'$custom_selected' => $custom,
'$showallOrigin' => $showall_origin,
'$showallIcon' => $showall_icon,
- '$select_label' => t('Who can see this?'),
+ '$select_label' => t('Share with'),
'$custom' => t('Custom selection'),
- '$showlimitedDesc' => t('Select "Show" to allow viewing. "Don\'t show" lets you override and limit the scope of "Show".'),
- '$show' => t('Show'),
- '$hide' => t("Don't show"),
+ '$custom_label' => t('Advanced'),
+ '$showlimitedDesc' => t('Select "Allow" to allow viewing. "Don\'t allow" lets you override and limit the scope of "Allow".'),
+ '$show' => t('Allow'),
+ '$hide' => t("Don't allow"),
'$search' => t('Search'),
'$allowcid' => json_encode($allow_cid),
'$allowgid' => json_encode($allow_gid),
diff --git a/include/bbcode.php b/include/bbcode.php
index e5b2a068a..d79429719 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -218,7 +218,7 @@ function bb_replace_images($body, $images) {
// We're depending on the property of 'foreach' (specified on the PHP website) that
// it loops over the array starting from the first element and going sequentially
// to the last element
- $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '<img src="' . $image .'" alt="' . t('Image/photo') . '" />', $newbody);
+ $newbody = str_replace('[$#saved_image' . $cnt . '#$]', '<img src="' . $image .'" alt="' . t('Image/photo') . '" loading="eager" />', $newbody);
$cnt++;
}
// logger('replace_images: ' . $newbody);
@@ -513,7 +513,7 @@ function bb_ShareAttributes($match) {
$headline = '<div id="shared_container_' . $rnd . '" class="shared_container"> <div id="shared_header_' . $rnd . '" class="shared_header">';
if ($avatar != "")
- $headline .= '<a href="' . (($auth) ? zid($profile) : $profile) . '" ><img src="' . $avatar . '" alt="' . $author . '" height="32" width="32" /></a>';
+ $headline .= '<a href="' . (($auth) ? zid($profile) : $profile) . '" ><img src="' . $avatar . '" alt="' . $author . '" height="32" width="32" loading="lazy" /></a>';
if(strpos($link,'/cards/'))
$type = t('card');
@@ -881,7 +881,7 @@ function bb_imgoptions($match) {
// now assemble the resulting img tag from these components
- $output = '<img ' . (($match[1] === 'z') ? 'class="zrl" ' : '') . ' ';
+ $output = '<img ' . (($match[1] === 'z') ? 'class="zrl" loading="eager"' : '') . ' ';
if ($width) {
$style .= 'width: 100%; max-width: ' . $width . 'px; ';
@@ -1483,19 +1483,19 @@ function bbcode($Text, $options = []) {
// Images
// [img]pathtoimage[/img]
if (strpos($Text,'[/img]') !== false) {
- $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" />', $Text);
+ $Text = preg_replace("/\[img\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" loading="eager" />', $Text);
}
// [img=pathtoimage]image description[/img]
if (strpos($Text,'[/img]') !== false) {
- $Text = preg_replace("/\[img=http(.*?)\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="http$1" alt="$2" title="$2"/>', $Text);
+ $Text = preg_replace("/\[img=http(.*?)\](.*?)\[\/img\]/ism", '<img style="max-width: 100%;" src="http$1" alt="$2" title="$2" loading="eager" />', $Text);
}
// [zmg]pathtoimage[/zmg]
if (strpos($Text,'[/zmg]') !== false) {
- $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" />', $Text);
+ $Text = preg_replace("/\[zmg\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="$1" alt="' . t('Image/photo') . '" loading="eager" />', $Text);
}
// [zmg=pathtoimage]image description[/zmg]
if (strpos($Text,'[/zmg]') !== false) {
- $Text = preg_replace("/\[zmg=http(.*?)\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="http$1" alt="$2" title="$2"/>', $Text);
+ $Text = preg_replace("/\[zmg=http(.*?)\](.*?)\[\/zmg\]/ism", '<img class="zrl" style="max-width: 100%;" src="http$1" alt="$2" title="$2" loading="eager" />', $Text);
}
$Text = preg_replace_callback("/\[([zi])mg([ \=])(.*?)\](.*?)\[\/[zi]mg\]/ism",'bb_imgoptions',$Text);
diff --git a/include/hubloc.php b/include/hubloc.php
index 059a4dadc..6b896c627 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -247,6 +247,7 @@ function hubloc_change_primary($hubloc) {
*
* We use the post url to distinguish between http and https hublocs.
* The https might be alive, and the http dead.
+ * Also set site_dead for the corresponding entry in the site table.
*
* @param string $posturl Hubloc callback url which to disable
*/
@@ -255,6 +256,13 @@ function hubloc_mark_as_down($posturl) {
intval(HUBLOC_OFFLINE),
dbesc($posturl)
);
+
+ // extract the baseurl and set site.site_dead to match
+ $m = parse_url($posturl);
+ $h = $m['scheme'] . '://' . $m['host'];
+ $r = q("update site set site_dead = 1 where site_url = '%s'",
+ dbesc($h)
+ );
}
diff --git a/include/text.php b/include/text.php
index 8bad8337f..ec397910d 100644
--- a/include/text.php
+++ b/include/text.php
@@ -3661,11 +3661,15 @@ function get_forum_channels($uid) {
if(! $uid)
return;
- $xf = false;
+ if(App::$data['forum_channels'])
+ return App::$data['forum_channels'];
+
+ $xf = '';
$x1 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'send_stream' and v = '0'",
intval($uid)
);
+
if($x1) {
$xc = ids_to_querystr($x1,'xchan',true);
@@ -3673,22 +3677,21 @@ function get_forum_channels($uid) {
intval($uid)
);
- if($x2) {
- $xf = ids_to_querystr($x2,'xchan',true);
+ $xf = ids_to_querystr($x2,'xchan',true);
+ $sql_extra = (($xf) ? ' and not xchan in (' . $xf . ')' : '');
- // private forums
- $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") and not xchan in (" . $xf . ") ",
- intval(local_channel())
- );
- if($x3) {
- $xf = ids_to_querystr(array_merge($x2,$x3),'xchan',true);
- }
+ // private forums
+ $x3 = q("select xchan from abconfig where chan = %d and cat = 'their_perms' and k = 'post_wall' and v = '1' and xchan in (" . $xc . ") $sql_extra ",
+ intval(local_channel())
+ );
+ if($x3) {
+ $xf = ids_to_querystr(array_merge($x2,$x3),'xchan',true);
}
}
- $sql_extra = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
+ $sql_extra_1 = (($xf) ? " and ( xchan_hash in (" . $xf . ") or xchan_pubforum = 1 ) " : " and xchan_pubforum = 1 ");
- $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_addr, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra order by xchan_name",
+ $r = q("select abook_id, xchan_hash, xchan_name, xchan_url, xchan_addr, xchan_photo_s from abook left join xchan on abook_xchan = xchan_hash where xchan_deleted = 0 and abook_channel = %d and abook_pending = 0 and abook_ignored = 0 and abook_blocked = 0 and abook_archived = 0 $sql_extra_1 order by xchan_name",
intval($uid)
);
@@ -3702,6 +3705,8 @@ function get_forum_channels($uid) {
}
}
+ App::$data['forum_channels'] = $r;
+
return $r;
}
@@ -3816,3 +3821,12 @@ function unserialise($x) {
return ((is_array($y)) ? $y : $x);
}
+/**
+ * @brief Remove new lines and tabs from strings.
+ *
+ * @return string
+ */
+function sanitize_text_field($str) {
+ return preg_replace('/\s+/S', ' ', $str);
+}
+
diff --git a/include/xchan.php b/include/xchan.php
index d69d707aa..5de828e7f 100644
--- a/include/xchan.php
+++ b/include/xchan.php
@@ -25,7 +25,7 @@ function xchan_store_lowlevel($arr) {
'xchan_connurl' => ((array_key_exists('xchan_connurl',$arr)) ? $arr['xchan_connurl'] : ''),
'xchan_follow' => ((array_key_exists('xchan_follow',$arr)) ? $arr['xchan_follow'] : ''),
'xchan_connpage' => ((array_key_exists('xchan_connpage',$arr)) ? $arr['xchan_connpage'] : ''),
- 'xchan_name' => ((array_key_exists('xchan_name',$arr)) ? $arr['xchan_name'] : ''),
+ 'xchan_name' => ((array_key_exists('xchan_name',$arr)) ? sanitize_text_field($arr['xchan_name']) : ''),
'xchan_network' => ((array_key_exists('xchan_network',$arr)) ? $arr['xchan_network'] : ''),
'xchan_instance_url' => ((array_key_exists('xchan_instance_url',$arr)) ? $arr['xchan_instance_url'] : ''),
'xchan_flags' => ((array_key_exists('xchan_flags',$arr)) ? intval($arr['xchan_flags']) : 0),
@@ -264,4 +264,4 @@ function xchan_change_key($oldx,$newx,$data) {
foreach($acls as $k => $v) {
xchan_keychange_acl($k,$v,$oldx,$newx);
}
-} \ No newline at end of file
+}
diff --git a/include/zot.php b/include/zot.php
index 4fa8bf14c..8a2177de7 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -5385,7 +5385,7 @@ function find_best_zot_identity($xchan) {
);
if ($r) {
$r = Libzot::zot_record_preferred($r);
- hz_syslog('find_best_zot_identity: ' . $xchan . ' > ' . $r['hubloc_hash']);
+ logger('find_best_zot_identity: ' . $xchan . ' > ' . $r['hubloc_hash']);
return $r['hubloc_hash'];
}
}
diff --git a/view/css/bootstrap-red.css b/view/css/bootstrap-red.css
index 984a5b4f9..122bb5904 100644
--- a/view/css/bootstrap-red.css
+++ b/view/css/bootstrap-red.css
@@ -11,29 +11,6 @@ nav .dropdown-menu {
min-width: 16rem;
}
-@media screen and (min-width: 992px) {
- nav .badge {
- top: 0px;
- left: 0px;
- line-height: 0.75;
- }
-}
-
-@media screen and (max-width: 992px) {
- .navbar {
- padding: .5rem 7px;
- }
-
- nav .badge {
- top: 0.5rem;
- left: 1.5rem;
- }
-}
-
-.widget .badge {
- font-size: 100%;
-}
-
.nav-item.nav-item-hack {
height: 2.3rem;
}
@@ -77,10 +54,6 @@ nav .dropdown-menu {
}
/* nav overrides end */
-.list-group-item:hover {
- text-decoration: none;
-}
-
label {
font-weight: bold;
}
diff --git a/view/js/acl.js b/view/js/acl.js
index 9415113dd..4597184ea 100644
--- a/view/js/acl.js
+++ b/view/js/acl.js
@@ -12,8 +12,13 @@ function ACL(backend_url) {
that.deny_cid = [];
that.deny_gid = [];
- that.group_uids = [];
- that.group_ids = [];
+ that.group_uids = {};
+ that.group_ids = {};
+ that.contact_uids = {};
+ that.contact_ids = {};
+
+ that.bang = '';
+
that.selected_id = '';
that.info = $("#acl-info");
@@ -78,6 +83,8 @@ ACL.prototype.get_form_data = function(event) {
that.deny_cid = (that.form_id.data('deny_cid') || []);
that.deny_gid = (that.form_id.data('deny_gid') || []);
+ that.bang = (that.form_id.data('bang') || '');
+
that.update_view();
that.on_submit();
@@ -147,15 +154,31 @@ ACL.prototype.on_showall = function(event) {
};
ACL.prototype.on_showgroup = function(event) {
- var xid = that.acl_select.children(":selected").val();
+
+ var xid = that.acl_select.val();
+ var cid = '';
+
+ if(xid.length && xid.substr(0,1) == '^') {
+ cid = xid.slice(1);
+ xid = '';
+ }
// preventDefault() isn't called here as we want state changes from update_view() to be applied to the radiobutton
event.stopPropagation();
- that.allow_cid = [];
- that.allow_gid = [xid];
- that.deny_cid = [];
- that.deny_gid = [];
+ if (xid.length) {
+ that.allow_cid = [];
+ that.allow_gid = [xid];
+ that.deny_cid = [];
+ that.deny_gid = [];
+
+ }
+ else {
+ that.allow_cid = [cid];
+ that.allow_gid = [];
+ that.deny_cid = [];
+ that.deny_gid = [];
+ }
that.update_view();
that.on_submit();
@@ -307,8 +330,26 @@ ACL.prototype.update_view = function(value) {
$('#dbtn-jotnets').hide();
$('.profile-jot-net input').attr('disabled', 'disabled');
}
+ else if (that.allow_gid.length === 0 && that.allow_cid.length === 1 && that.deny_gid.length === 0 && that.deny_cid.length === 0 && value !== 'custom') {
+
+ if(that.bang && that.bang !== that.allow_cid[0]) {
+ that.update_view('custom');
+ return;
+ }
+
+ that.list.hide(); //hide acl-list
+ that.info.hide(); //show acl-info
+ that.selected_id = that.contact_ids[that.allow_cid[0]];
+ that.update_select('\\^' + that.selected_id);
+
+ /* jot acl */
+ $('#jot-perms-icon, #dialog-perms-icon, #' + that.form_id[0].id + ' .jot-perms-icon').removeClass('fa-unlock').addClass('fa-lock');
+ $('#dbtn-jotnets').hide();
+ $('.profile-jot-net input').attr('disabled', 'disabled');
+ }
else {
+
that.list.show(); //show acl-list
datasrc2src('#acl-list-content .list-group-item img[data-src]');
that.info.hide(); //hide acl-info
@@ -382,6 +423,21 @@ ACL.prototype.update_view = function(value) {
bthide.removeClass("btn-outline-danger").addClass("btn-danger");
$(this).removeClass("groupshow");
}
+ $(that.contact_uids[id]).each(function(i, v) {
+ if(uclass == "grouphide")
+ // we need attr selection here because the id can include an @ (diaspora/friendica xchans)
+ $('[id="g' + v + '"]').removeClass("groupshow");
+ if(uclass !== "") {
+ var cls = $('[id="g' + v + '"]').attr('class');
+ if( cls === undefined)
+ return true;
+ var hiding = cls.indexOf('grouphide');
+ if(hiding == -1)
+ $('[id="g' + v + '"]').addClass(uclass);
+ }
+ });
+ break;
+
}
});
}
@@ -415,9 +471,13 @@ ACL.prototype.populate = function(data) {
that.group_uids[this.xid] = this.uids;
that.group_ids[this.xid] = this.id;
}
+ else {
+ that.contact_ids[this.xid] = this.id;
+ }
if (this.self === 'abook-self') {
that.self[0] = this.xid;
}
+
that.list_content.append(html);
});
};
diff --git a/view/js/autocomplete.js b/view/js/autocomplete.js
index 660b5f190..27011b4d4 100644
--- a/view/js/autocomplete.js
+++ b/view/js/autocomplete.js
@@ -40,7 +40,7 @@ function contact_format(item) {
var desc = ((item.label) ? item.nick + ' ' + item.label : item.nick);
if(typeof desc === 'undefined') desc = '';
if(desc) desc = ' ('+desc+')';
- return "<div class='{0} dropdown-item dropdown-notification clearfix' title='{4}'><img class='menu-img-2' src='{1}'><span class='contactname'>{2}</span><span class='dropdown-sub-text'>{4}</span></div>".format(item.taggable, item.photo, item.name, desc, typeof(item.link) !== 'undefined' ? item.link : desc.replace('(','').replace(')',''));
+ return "<div class='{0} dropdown-item dropdown-notification clearfix' title='{4}'><img class='menu-img-2' src='{1}' loading='lazy'><span class='font-weight-bold contactname'>{2}</span><span class='dropdown-sub-text'>{4}</span></div>".format(item.taggable, item.photo, item.name, desc, typeof(item.link) !== 'undefined' ? item.link : desc.replace('(','').replace(')',''));
}
else
return "<div>" + item.text + "</div>";
diff --git a/view/js/main.js b/view/js/main.js
index 29f7ed7ca..fb7bcb52f 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -30,6 +30,7 @@ var sse_bs_active = false;
var sse_offset = 0;
var sse_type;
var sse_partial_result = false;
+var sse_rmids = [];
var page_cache = {};
@@ -176,8 +177,7 @@ $(document).ready(function() {
$('.notification-content').on('scroll', function() {
if(this.scrollTop > this.scrollHeight - this.clientHeight - (this.scrollHeight/7)) {
- if(!sse_bs_active)
- sse_bs_notifications(sse_type, false, true);
+ sse_bs_notifications(sse_type, false, true);
}
});
@@ -545,7 +545,7 @@ function markRead(notifType) {
function markItemRead(itemId) {
$.get('ping?f=&markItemRead='+itemId);
- $('.unseen-wall-indicator-'+itemId).hide();
+ $('.unseen-wall-indicator-'+itemId).remove();
}
function contextualHelp() {
@@ -710,6 +710,9 @@ function updateConvItems(mode,data) {
var nmids = $(this).data('b64mids');
nmids.forEach(function(nmid, index) {
+
+ sse_rmids.push(nmid);
+
if($('.notification[data-b64mid=\'' + nmid + '\']').length) {
$('.notification[data-b64mid=\'' + nmid + '\']').each(function() {
var n = this.parentElement.id.split('-');
@@ -743,12 +746,6 @@ function updateConvItems(mode,data) {
});
- // We are actually dealing with counts in sse_updateNotifications()
- // for notifications which are already visible. For the case where
- // unseen items were loaded but their notifications are not yet visible
- // we need to bootstrap counts here to stay in sync with the DB after
- // the first page load.
-
if(followUpPageLoad)
sse_bs_counts();
else
@@ -1766,14 +1763,31 @@ function sse_bs_init() {
}
function sse_bs_counts() {
- $.get('/sse_bs',function(obj) {
+
+
+ if(sse_bs_active)
+ return;
+
+ sse_bs_active = true;
+
+ $.ajax({
+ type: 'post',
+ url: '/sse_bs',
+ data: { sse_rmids }
+ }).done( function(obj) {
console.log(obj);
+ sse_bs_active = false;
+ sse_rmids = [];
sse_handleNotifications(obj, true, false);
});
}
function sse_bs_notifications(e, replace, followup) {
- sse_bs_active = true;
+
+ if(sse_bs_active)
+ return;
+
+
var manual = false;
if(typeof replace === 'undefined')
@@ -1805,17 +1819,23 @@ function sse_bs_notifications(e, replace, followup) {
var cn_val = (($('#cn-' + sse_type + '-input').length && sse_partial_result) ? $('#cn-' + sse_type + '-input').val().toString().toLowerCase() : '');
- $.get('/sse_bs/' + sse_type + '/' + sse_offset + '?nquery=' + encodeURIComponent(cn_val), function(obj) {
+ $("#nav-" + sse_type + "-loading").show();
+
+ sse_bs_active = true;
+
+ $.ajax({
+ type: 'post',
+ url: '/sse_bs/' + sse_type + '/' + sse_offset,
+ nquery: encodeURIComponent(cn_val),
+ data: { sse_rmids }
+ }).done(function(obj) {
console.log('sse: bootstraping ' + sse_type);
console.log(obj);
-
sse_bs_active = false;
+ sse_rmids = [];
+ $("#nav-" + sse_type + "-loading").hide();
sse_offset = obj[sse_type].offset;
- if(sse_offset < 0)
- $("#nav-" + sse_type + "-loading").hide();
-
sse_handleNotifications(obj, replace, followup);
-
});
}
else
@@ -1836,14 +1856,21 @@ function sse_handleNotifications(obj, replace, followup) {
var all_notifications = primary_notifications.concat(secondary_notifications);
all_notifications.forEach(function(type, index) {
- if(obj[type] && obj[type].count) {
+ if(typeof obj[type] === typeof undefined)
+ return true;
+
+ if(obj[type].count) {
$('.' + type + '-button').fadeIn();
if(replace || followup)
$('.' + type + '-update').html(Number(obj[type].count));
else
$('.' + type + '-update').html(Number(obj[type].count) + Number($('.' + type + '-update').html()));
}
- if(obj[type] && obj[type].notifications.length)
+ else {
+ $('.' + type + '-update').html('0');
+ $('.' + type + '-button').fadeOut();
+ }
+ if(obj[type].notifications.length)
sse_handleNotificationsItems(type, obj[type].notifications, replace, followup);
});
@@ -1864,10 +1891,18 @@ function sse_handleNotifications(obj, replace, followup) {
});
}
+ // load more notifications if visible notifications count becomes low
+ if(sse_type && sse_offset != -1 && $('#nav-' + sse_type + '-menu').children().length <= 20) {
+ sse_offset = 0;
+ sse_bs_notifications(sse_type, false, true);
+ }
+
+
}
function sse_handleNotificationsItems(notifyType, data, replace, followup) {
- var notifications_tpl = ((notifyType == 'forums') ? decodeURIComponent($("#nav-notifications-forums-template[rel=template]").html()) : decodeURIComponent($("#nav-notifications-template[rel=template]").html()));
+
+ var notifications_tpl = ((notifyType == 'forums') ? decodeURIComponent($("#nav-notifications-forums-template[rel=template]").html().replace('data-src', 'src')) : decodeURIComponent($("#nav-notifications-template[rel=template]").html().replace('data-src', 'src')));
var notify_menu = $("#nav-" + notifyType + "-menu");
var notify_loading = $("#nav-" + notifyType + "-loading");
var notify_count = $("." + notifyType + "-update");
@@ -1878,6 +1913,11 @@ function sse_handleNotificationsItems(notifyType, data, replace, followup) {
}
$(data).each(function() {
+
+ // do not add a notification if it is already present
+ if($('#nav-' + notifyType + '-menu .notification[data-b64mid=\'' + this.b64mid + '\']').length)
+ return true;
+
html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.addr,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum, encodeURIComponent(this.mids), this.body);
notify_menu.append(html);
});
@@ -1920,7 +1960,7 @@ function sse_updateNotifications(type, mid) {
if(type === 'notify' && (mid !== bParam_mid || sse_type !== 'notify'))
return true;
-
+/*
var count = Number($('.' + type + '-update').html());
count--;
@@ -1934,6 +1974,7 @@ function sse_updateNotifications(type, mid) {
else {
$('.' + type + '-update').html(count);
}
+*/
$('#nav-' + type + '-menu .notification[data-b64mid=\'' + mid + '\']').fadeOut(function() {
this.remove();
@@ -1977,4 +2018,5 @@ function sse_setNotificationsStatus() {
$('#no_notifications').show();
$('#notifications').hide();
}
+
}
diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css
index 08a6e9d19..545e610b5 100644
--- a/view/theme/redbasic/css/style.css
+++ b/view/theme/redbasic/css/style.css
@@ -799,8 +799,6 @@ div.jGrowl div.jGrowl-notification {
}
.contactname {
- font-weight: bold;
- color: $font_colour;
display: block;
overflow: hidden;
text-overflow: ellipsis;
diff --git a/view/tpl/acl_selector.tpl b/view/tpl/acl_selector.tpl
index 3d05cb455..c58a345e5 100755
--- a/view/tpl/acl_selector.tpl
+++ b/view/tpl/acl_selector.tpl
@@ -15,12 +15,14 @@
{{if $aclModalDesc}}
<div id="acl-dialog-description" class="section-content-info-wrapper">{{$aclModalDesc}}</div>
{{/if}}
- <label for="acl-select">{{$select_label}}</label>
+ <label for="acl-select">{{if $aclModalDesc}}<i class="fa fa-send-o"></i> {{/if}}{{$select_label}}</label>
<select id="acl-select" name="optionsRadios" class="form-control form-group">
<option id="acl-showall" value="public" {{$public_selected}}>{{$showall}}</option>
- {{$groups}}
<option id="acl-onlyme" value="onlyme" {{$justme_selected}}>{{$onlyme}}</option>
- <option id="acl-custom" value="custom" {{$custom_selected}}>{{$custom}}</option>
+ {{$groups}}
+ <optgroup label = "{{$custom_label}}">;
+ <option id="acl-custom" value="custom" {{$custom_selected}}>{{$custom}}</option>
+ </optgroup>;
</select>
{{if $showallOrigin}}
@@ -39,8 +41,8 @@
<div class="list-group-item acl-list-item" rel="acl-template" style="display:none">
<div class="acl-item-header clearfix">
- <img class="menu-img-3" data-src="{0}">
- <span class="contactname">{1}</span>
+ <img class="menu-img-3" data-src="{0}" loading="lazy" />
+ <span class="font-weight-bold contactname">{1}</span>
<span class="dropdown-sub-text">{6}</span>
</div>
<button class="acl-button-hide btn btn-sm btn-outline-danger"><i class="fa fa-times"></i> {{$hide}}</button>
diff --git a/view/tpl/connection_template.tpl b/view/tpl/connection_template.tpl
index f9b46b41e..86a230c7f 100755
--- a/view/tpl/connection_template.tpl
+++ b/view/tpl/connection_template.tpl
@@ -22,7 +22,7 @@
<div class="section-content-tools-wrapper">
<div class="contact-photo-wrapper" >
<a href="{{$contact.url}}" title="{{$contact.img_hover}}" >
- <img class="directory-photo-img {{if $contact.classes}}{{$contact.classes}}{{/if}}" src="{{$contact.thumb}}" alt="{{$contact.name}}" />
+ <img class="directory-photo-img {{if $contact.classes}}{{$contact.classes}}{{/if}}" src="{{$contact.thumb}}" alt="{{$contact.name}}" loading="lazy" />
</a>
{{include "connstatus.tpl" perminfo=$contact.perminfo}}
</div>
diff --git a/view/tpl/contact_template.tpl b/view/tpl/contact_template.tpl
index 73fa5adde..7c8c02ea2 100755
--- a/view/tpl/contact_template.tpl
+++ b/view/tpl/contact_template.tpl
@@ -1,6 +1,6 @@
<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" >
<div class="contact-entry-photo-wrapper" >
- <a href="{{$contact.link}}" title="{{$contact.img_hover}}" ><img class="contact-block-img" src="{{$contact.thumb}}" alt="{{$contact.name}}" /></a>
+ <a href="{{$contact.link}}" title="{{$contact.img_hover}}" ><img class="contact-block-img" src="{{$contact.thumb}}" alt="{{$contact.name}}" loading="lazy" /></a>
{{if $contact.perminfo}}{{include "connstatus.tpl" perminfo=$contact.perminfo}}{{/if}}
</div>
<div class="contact-entry-photo-end" ></div>
diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl
index f48e88006..d7eaefe7e 100755
--- a/view/tpl/conv_item.tpl
+++ b/view/tpl/conv_item.tpl
@@ -35,7 +35,7 @@
{{/if}}
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}">
- <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" />
+ <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" loading="lazy" data-toggle="dropdown" />
{{if $item.thread_author_menu}}
<i class="fa fa-caret-down wall-item-photo-caret cursor-pointer" data-toggle="dropdown"></i>
<div class="dropdown-menu">
diff --git a/view/tpl/conv_list.tpl b/view/tpl/conv_list.tpl
index 21c38829a..113cf2324 100755
--- a/view/tpl/conv_list.tpl
+++ b/view/tpl/conv_list.tpl
@@ -29,7 +29,7 @@
<div class="p-2 clearfix wall-item-head{{if !$item.title && !$item.event && !$item.photo}} rounded-top{{/if}}{{if $item.is_new && !$item.event && !$item.is_comment}} wall-item-head-new{{/if}}">
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}} h-card p-author" id="wall-item-photo-wrapper-{{$item.id}}">
- <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" /></a>
+ <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" loading="lazy" /></a>
{{if $item.thread_author_menu}}
<i class="fa fa-caret-down wall-item-photo-caret cursor-pointer" data-toggle="dropdown"></i>
<div class="dropdown-menu">
diff --git a/view/tpl/direntry.tpl b/view/tpl/direntry.tpl
index 175d813c5..015f1102d 100755
--- a/view/tpl/direntry.tpl
+++ b/view/tpl/direntry.tpl
@@ -23,7 +23,7 @@
<div class="contact-photo-wrapper" id="directory-photo-wrapper-{{$entry.hash}}" >
<div class="contact-photo" id="directory-photo-{{$entry.hash}}" >
<a href="{{$entry.profile_link}}" class="directory-profile-link" id="directory-profile-link-{{$entry.hash}}" >
- <img class="directory-photo-img" src="{{$entry.photo}}" alt="{{$entry.alttext}}" title="{{$entry.alttext}}" />
+ <img class="directory-photo-img" src="{{$entry.photo}}" alt="{{$entry.alttext}}" title="{{$entry.alttext}}" loading="lazy"/>
</a>
</div>
</div>
diff --git a/view/tpl/jot.tpl b/view/tpl/jot.tpl
index 4e496b511..36543ccfa 100755
--- a/view/tpl/jot.tpl
+++ b/view/tpl/jot.tpl
@@ -1,6 +1,6 @@
<input id="invisible-wall-file-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple>
<input id="invisible-comment-upload" type="file" name="files" style="visibility:hidden;position:absolute;top:-50;left:-50;width:0;height:0;" multiple>
-<form id="profile-jot-form" action="{{$action}}" method="post" class="acl-form" data-form_id="profile-jot-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}'>
+<form id="profile-jot-form" action="{{$action}}" method="post" class="acl-form" data-form_id="profile-jot-form" data-allow_cid='{{$allow_cid}}' data-allow_gid='{{$allow_gid}}' data-deny_cid='{{$deny_cid}}' data-deny_gid='{{$deny_gid}}' data-bang='{{$bang}}'>
{{$mimeselect}}
{{$layoutselect}}
{{if $id_select}}
diff --git a/view/tpl/micropro_img.tpl b/view/tpl/micropro_img.tpl
index 98f33d119..5bfca615f 100755
--- a/view/tpl/micropro_img.tpl
+++ b/view/tpl/micropro_img.tpl
@@ -1 +1 @@
-<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" />{{if $perminfo}}{{include "connstatus.tpl"}}{{/if}}</a></div>
+<div class="contact-block-div{{if $class}} {{$class}}{{/if}}"><a class="contact-block-link{{if $class}} {{$class}}{{/if}}{{if $click}} fakelink{{/if}}" href="{{if $click}}#{{else}}{{$url}}{{/if}}" {{if $click}}onclick="{{$click}}"{{/if}}><img class="contact-block-img{{if $class}} {{$class}}{{/if}}" src="{{$photo}}" title="{{$title}}" alt="" loading="lazy" />{{if $perminfo}}{{include "connstatus.tpl"}}{{/if}}</a></div>
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index abfc922f2..1a24ca7c4 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -142,17 +142,17 @@
{{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
</div>
<div id="nav-notifications-template" rel="template">
- <a class="list-group-item clearfix notification {6}" href="{0}" title="{13}" data-b64mid="{7}" data-notify_id="{8}" data-thread_top="{9}" data-contact_name="{2}" data-contact_addr="{3}" data-when="{5}">
- <img class="menu-img-3" src="{1}">
- <span class="contactname">{2} <span class="font-weight-normal text-muted">{3}</span></span>
- <span class="dropdown-sub-text">{4}</span><br>
- <span class="dropdown-sub-text notifications-autotime" title="{5}">{5}</span>
+ <a class="list-group-item text-decoration-none text-darkclearfix notification {6}" href="{0}" title="{13}" data-b64mid="{7}" data-notify_id="{8}" data-thread_top="{9}" data-contact_name="{2}" data-contact_addr="{3}" data-when="{5}">
+ <img class="menu-img-3" data-src="{1}" loading="lazy">
+ <div class="contactname"><span class="text-dark font-weight-bold">{2}</span> <span class="text-muted">{3}</span></div>
+ <span class="text-muted">{4}</span><br>
+ <span class="text-muted notifications-autotime" title="{5}">{5}</span>
</a>
</div>
<div id="nav-notifications-forums-template" rel="template">
- <a class="list-group-item clearfix notification notification-forum" href="{0}" title="{4} - {3}" data-b64mid="{7}" data-notify_id="{8}" data-thread_top="{9}" data-contact_name="{2}" data-contact_addr="{3}" data-b64mids='{12}'>
+ <a class="list-group-item text-decoration-none clearfix notification notification-forum" href="{0}" title="{4} - {3}" data-b64mid="{7}" data-notify_id="{8}" data-thread_top="{9}" data-contact_name="{2}" data-contact_addr="{3}" data-b64mids='{12}'>
<span class="float-right badge badge-secondary">{10}</span>
- <img class="menu-img-1" src="{1}">
+ <img class="menu-img-1" data-src="{1}" loading="lazy">
<span class="">{2}</span>
<i class="fa fa-{11} text-muted"></i>
</a>
@@ -160,13 +160,13 @@
<div id="notifications" class="border border-bottom-0 rounded navbar-nav collapse">
{{foreach $notifications as $notification}}
<div class="rounded list-group list-group-flush collapse {{$notification.type}}-button">
- <a id="notification-link-{{$notification.type}}" class="collapsed list-group-item notification-link" href="#" title="{{$notification.title}}" data-target="#nav-{{$notification.type}}-sub" data-toggle="collapse" data-sse_type="{{$notification.type}}">
+ <a id="notification-link-{{$notification.type}}" class="collapsed list-group-item text-decoration-none notification-link" href="#" title="{{$notification.title}}" data-target="#nav-{{$notification.type}}-sub" data-toggle="collapse" data-sse_type="{{$notification.type}}">
<i class="fa fa-fw fa-{{$notification.icon}}"></i> {{$notification.label}}
<span class="float-right badge badge-{{$notification.severity}} {{$notification.type}}-update"></span>
</a>
<div id="nav-{{$notification.type}}-sub" class="list-group list-group-flush border border-left-0 border-top-0 border-right-0 collapse notification-content" data-parent="#notifications" data-sse_type="{{$notification.type}}">
{{if $notification.viewall}}
- <a class="list-group-item text-dark" id="nav-{{$notification.type}}-see-all" href="{{$notification.viewall.url}}">
+ <a class="list-group-item text-decoration-none text-dark" id="nav-{{$notification.type}}-see-all" href="{{$notification.viewall.url}}">
<i class="fa fa-fw fa-external-link"></i> {{$notification.viewall.label}}
</a>
{{/if}}
diff --git a/view/tpl/photo_top.tpl b/view/tpl/photo_top.tpl
index a86aa7f80..16862a8d6 100755
--- a/view/tpl/photo_top.tpl
+++ b/view/tpl/photo_top.tpl
@@ -1,4 +1,4 @@
<a href="{{$photo.link}}" id="photo-top-photo-link-{{$photo.id}}" title="{{$photo.title}}">
- <img src="{{$photo.src}}" alt="{{if $photo.album.name}}{{$photo.album.name}}{{elseif $photo.desc}}{{$photo.desc}}{{elseif $photo.alt}}{{$photo.alt}}{{else}}{{$photo.unknown}}{{/if}}" title="{{$photo.title}}" id="photo-top-photo-{{$photo.id}}" />
+ <img src="{{$photo.src}}" alt="{{if $photo.album.name}}{{$photo.album.name}}{{elseif $photo.desc}}{{$photo.desc}}{{elseif $photo.alt}}{{$photo.alt}}{{else}}{{$photo.unknown}}{{/if}}" title="{{$photo.title}}" id="photo-top-photo-{{$photo.id}}" loading="lazy" />
</a>
diff --git a/view/tpl/search_item.tpl b/view/tpl/search_item.tpl
index 40341a840..3e986ea21 100755
--- a/view/tpl/search_item.tpl
+++ b/view/tpl/search_item.tpl
@@ -23,7 +23,7 @@
<div class="p-2 clearfix wall-item-head{{if !$item.title && !$item.event && !$item.photo}} rounded-top{{/if}}{{if $item.is_new && !$item.event && !$item.is_comment}} wall-item-head-new{{/if}}" >
<div class="wall-item-info" id="wall-item-info-{{$item.id}}" >
<div class="wall-item-photo-wrapper{{if $item.owner_url}} wwfrom{{/if}}" id="wall-item-photo-wrapper-{{$item.id}}">
- <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" />
+ <img src="{{$item.thumb}}" class="fakelink wall-item-photo{{$item.sparkle}} u-photo p-name" id="wall-item-photo-{{$item.id}}" alt="{{$item.name}}" data-toggle="dropdown" loading="lazy" />
{{if $item.thread_author_menu}}
<i class="fa fa-caret-down wall-item-photo-caret cursor-pointer" data-toggle="dropdown"></i>
<div class="dropdown-menu">