From 5497adfde6e1df941d42bb8fb6e18b261402716e Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 18 Sep 2021 18:06:32 +0000 Subject: add option to mark all notices of a thread read if a notice of the thread is clicked (default 1) and fix a php error in find_parent() if $act->obj is not an array --- Zotlabs/Lib/Libzot.php | 2 +- Zotlabs/Module/Notify.php | 28 ++++++++++++++++++++++------ Zotlabs/Module/Settings/Channel.php | 9 +++++++-- 3 files changed, 30 insertions(+), 9 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index e03f0173d..531b83359 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1339,7 +1339,7 @@ class Libzot { static function find_parent($env, $act) { if ($act) { - if (in_array($act->type, ['Like', 'Dislike'])) { + if (in_array($act->type, ['Like', 'Dislike']) && is_array($act->obj)) { return $act->obj['id']; } if ($act->parent_id) { diff --git a/Zotlabs/Module/Notify.php b/Zotlabs/Module/Notify.php index 5bfcec4f7..4cbcfee05 100644 --- a/Zotlabs/Module/Notify.php +++ b/Zotlabs/Module/Notify.php @@ -1,19 +1,35 @@ array('vnotify15', t('Unseen forum posts'), ($vnotify & VNOTIFY_FORUMS), VNOTIFY_FORUMS, '', $yes_no), '$mailhost' => [ 'mailhost', t('Email notification hub (hostname)'), get_pconfig(local_channel(),'system','email_notify_host',\App::get_hostname()), sprintf( t('If your channel is mirrored to multiple hubs, set this to your preferred location. This will prevent duplicate email notifications. Example: %s'),\App::get_hostname()) ], '$always_show_in_notices' => array('always_show_in_notices', t('Show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no), + '$update_notices_per_parent' => array('update_notices_per_parent', t('Mark all notices of the thread read if a notice is clicked'), $update_notices_per_parent, 1, t('If no, only the clicked notice will be marked read'), $yes_no), '$desktop_notifications_info' => t('Desktop notifications are unavailable because the required browser permission has not been granted'), '$desktop_notifications_request' => t('Grant permission'), '$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')), -- cgit v1.2.3