aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Notify.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
committerMario <mario@mariovavti.com>2021-11-09 09:10:19 +0000
commitfe7ecede700fe04631d23f36473e697ce2b364dc (patch)
treee713fc39dba500a25cb2acf8561e286fb8b41ff0 /Zotlabs/Module/Notify.php
parent42de18d96d201d74e5df3ed1b8f6132cb00357b6 (diff)
parent089708ab9f90309a0c27ae633cf8f2604fce1170 (diff)
downloadvolse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.gz
volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.tar.bz2
volse-hubzilla-fe7ecede700fe04631d23f36473e697ce2b364dc.zip
Merge branch '6.4RC'6.4
Diffstat (limited to 'Zotlabs/Module/Notify.php')
-rw-r--r--Zotlabs/Module/Notify.php28
1 files changed, 22 insertions, 6 deletions
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 @@
<?php
namespace Zotlabs\Module;
+use \Zotlabs\Lib\PConfig;
+use \Zotlabs\Web\Controller;
-
-class Notify extends \Zotlabs\Web\Controller {
+class Notify extends Controller {
function init() {
if(! local_channel())
return;
if($_REQUEST['notify_id']) {
- q("update notify set seen = 1 where id = %d and uid = %d",
- intval($_REQUEST['notify_id']),
- intval(local_channel())
- );
+ $update_notices_per_parent = PConfig::Get(local_channel(), 'system', 'update_notices_per_parent', 1);
+
+ if($update_notices_per_parent) {
+ $r = q("SELECT parent FROM notify WHERE id = %d AND uid = %d",
+ intval($_REQUEST['notify_id']),
+ intval(local_channel())
+ );
+ q("update notify set seen = 1 where parent = '%s' and uid = %d",
+ dbesc($r[0]['parent']),
+ intval(local_channel())
+ );
+ }
+ else {
+ q("update notify set seen = 1 where id = %d and uid = %d",
+ intval($_REQUEST['notify_id']),
+ intval(local_channel())
+ );
+ }
+
killme();
}