aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Module/Channel.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-10-22 11:33:25 +0000
committerMario <mario@mariovavti.com>2020-10-22 11:33:25 +0000
commit96de38a1f06193d674f8fe89cb1852e0e4abb4cf (patch)
tree8ae120d73a0e59c4e581d7b63b659ad106b1b672 /Zotlabs/Module/Channel.php
parentcef0c2ebb2b16b006eca7dce8ec0b1a95d916dba (diff)
downloadvolse-hubzilla-96de38a1f06193d674f8fe89cb1852e0e4abb4cf.tar.gz
volse-hubzilla-96de38a1f06193d674f8fe89cb1852e0e4abb4cf.tar.bz2
volse-hubzilla-96de38a1f06193d674f8fe89cb1852e0e4abb4cf.zip
adapt notifications and mark item seen handling to play well with client side page caching
Diffstat (limited to 'Zotlabs/Module/Channel.php')
-rw-r--r--Zotlabs/Module/Channel.php40
1 files changed, 4 insertions, 36 deletions
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');