aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2018-11-03 20:53:23 +0100
committerMario Vavti <mario@mariovavti.com>2018-11-03 20:53:23 +0100
commitde32b0bba55d8570214546df5d3f50397308001f (patch)
tree554ea153fc487b2b96878c77f39d620086763bda /Zotlabs
parent75f7b1e261a2783b8a90f374434316a1c148e3b8 (diff)
downloadvolse-hubzilla-de32b0bba55d8570214546df5d3f50397308001f.tar.gz
volse-hubzilla-de32b0bba55d8570214546df5d3f50397308001f.tar.bz2
volse-hubzilla-de32b0bba55d8570214546df5d3f50397308001f.zip
more fixes for forum notifications handling: do not count likes/dislikes if likes notifications are disabled and also do not show like activities when clicking a forum notification and like notifications are disabled
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Network.php6
-rw-r--r--Zotlabs/Module/Ping.php2
2 files changed, 6 insertions, 2 deletions
diff --git a/Zotlabs/Module/Network.php b/Zotlabs/Module/Network.php
index 294e11c52..b93faa612 100644
--- a/Zotlabs/Module/Network.php
+++ b/Zotlabs/Module/Network.php
@@ -258,6 +258,10 @@ class Network extends \Zotlabs\Web\Controller {
}
elseif($pf && $unseen && $nouveau) {
+ $vnotify = get_pconfig(local_channel(), 'system', 'vnotify');
+ if(! ($vnotify & VNOTIFY_LIKE))
+ $likes_sql = " AND verb NOT IN ('" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') ";
+
// This is for nouveau view public forum cid queries (if a forum notification is clicked)
$p = q("SELECT oid AS parent FROM term WHERE uid = %d AND ttype = %d AND term = '%s'",
intval(local_channel()),
@@ -269,7 +273,7 @@ class Network extends \Zotlabs\Web\Controller {
if($p_str)
$p_sql = " OR item.parent IN ( $p_str ) ";
- $sql_extra = " AND ( owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' OR owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' $p_sql ) AND item_unseen = 1 ";
+ $sql_extra = " AND ( owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' OR owner_xchan = '" . protect_sprintf(dbesc($cid_r[0]['abook_xchan'])) . "' $p_sql ) AND item_unseen = 1 $likes_sql ";
}
else {
// This is for threaded view cid queries (e.g. if a forum is selected from the forum filter)
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index cf5b2e004..f660c3b55 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -650,7 +650,7 @@ class Ping extends \Zotlabs\Web\Controller {
$p_sql = (($p_str) ? "OR parent IN ( $p_str )" : '');
$r = q("select count(id) as unseen from item
- where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $item_normal",
+ where uid = %d and ( owner_xchan = '%s' OR author_xchan = '%s' $p_sql ) and item_unseen = 1 $item_normal $sql_extra",
intval(local_channel()),
dbesc($forums[$x]['xchan_hash']),
dbesc($forums[$x]['xchan_hash'])