diff options
-rw-r--r-- | Zotlabs/Widget/Messages.php | 14 | ||||
-rw-r--r-- | view/tpl/messages_widget.tpl | 4 |
2 files changed, 15 insertions, 3 deletions
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 199bd8665..2ba1f4da5 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -63,6 +63,16 @@ class Messages { $limit = 30; $dummy_order_sql = ''; $loadtime = (($offset) ? $_SESSION['messages_loadtime'] : datetime_convert()); + $vnotify = get_pconfig(local_channel(), 'system', 'vnotify', -1); + + $vnotify_sql = ''; + + if (!($vnotify & VNOTIFY_LIKE)) { + $vnotify_sql = " AND verb NOT IN ('" . dbesc(ACTIVITY_LIKE) . "', '" . dbesc(ACTIVITY_DISLIKE) . "') "; + } + elseif (!feature_enabled(local_channel(), 'dislike')) { + $vnotify_sql = " AND verb NOT IN ('" . dbesc(ACTIVITY_DISLIKE) . "') "; + } switch($type) { case 'direct': @@ -151,7 +161,8 @@ class Messages { $unseen = q("SELECT count(id) AS total FROM item WHERE uid = %d AND parent = %d AND item_thread_top = 0 - AND item_unseen = 1", + AND item_unseen = 1 + $vnotify_sql", intval(local_channel()), intval($item['id']) ); @@ -165,6 +176,7 @@ class Messages { $entries[$i]['href'] = z_root() . '/hq/' . gen_link_id($item['mid']); $entries[$i]['icon'] = $icon; $entries[$i]['unseen'] = (($unseen[0]['total']) ? $unseen[0]['total'] : (($item['item_unseen']) ? ' ' : '')); + $entries[$i]['unseen_class'] = (($item['item_unseen']) ? 'bg-primary' : 'bg-secondary'); $i++; } diff --git a/view/tpl/messages_widget.tpl b/view/tpl/messages_widget.tpl index 90f8e13c7..ed3bc0aaf 100644 --- a/view/tpl/messages_widget.tpl +++ b/view/tpl/messages_widget.tpl @@ -54,7 +54,7 @@ </div> <small>{{$e.info}}</small> {{if $e.unseen}} - <span class="badge bg-primary rounded-pill position-absolute bottom-0 end-0 m-2" title="{{$strings.unseen}}">{{$e.unseen}}</span> + <span class="badge {{$e.unseen_class}} rounded-pill position-absolute bottom-0 end-0 m-2" title="{{$strings.unseen}}">{{$e.unseen}}</span> {{/if}} </a> {{/foreach}} @@ -129,7 +129,7 @@ e.author_addr, e.href, e.icon, - e.unseen ? '<span class="badge bg-primary rounded-pill position-absolute bottom-0 end-0 m-2" title="{{$strings.unseen}}">' + e.unseen + '</span>' : '' + e.unseen ? '<span class="badge ' + e.unseen_class + ' rounded-pill position-absolute bottom-0 end-0 m-2" title="{{$strings.unseen}}">' + e.unseen + '</span>' : '' ); $('#messages-loading').before(html); }); |