aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-12-01 03:03:14 +0000
committerMario <mario@mariovavti.com>2018-12-02 10:17:45 +0100
commit4b4cc0489729e061f18a825e0e0be3fa0a9d8353 (patch)
tree70522484f1692cbeae39731b4497207c51752515
parent4bf3d4d87ac23af339f6418055211037b020cf1d (diff)
downloadvolse-hubzilla-4b4cc0489729e061f18a825e0e0be3fa0a9d8353.tar.gz
volse-hubzilla-4b4cc0489729e061f18a825e0e0be3fa0a9d8353.tar.bz2
volse-hubzilla-4b4cc0489729e061f18a825e0e0be3fa0a9d8353.zip
allow notification filtering by name or addr
(cherry picked from commit c6acb6191ca558fce121e7df26a8aba88beac2d9)
-rw-r--r--Zotlabs/Lib/Enotify.php1
-rw-r--r--Zotlabs/Module/Ping.php8
-rw-r--r--view/js/main.js2
-rw-r--r--view/tpl/notifications_widget.tpl13
4 files changed, 16 insertions, 8 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 25c96d9cc..523ccf93a 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -828,6 +828,7 @@ class Enotify {
$x = array(
'notify_link' => $item['llink'],
'name' => $item['author']['xchan_name'],
+ 'addr' => $item['author']['xchan_addr'],
'url' => $item['author']['xchan_url'],
'photo' => $item['author']['xchan_photo_s'],
'when' => relative_date(($edit)? $item['edited'] : $item['created']),
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index f660c3b55..12244d88c 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -330,6 +330,7 @@ class Ping extends \Zotlabs\Web\Controller {
$notifs[] = array(
'notify_link' => z_root() . '/mail/' . $zz['id'],
'name' => $zz['xchan_name'],
+ 'addr' => $zz['xchan_addr'],
'url' => $zz['xchan_url'],
'photo' => $zz['xchan_photo_s'],
'when' => relative_date($zz['created']),
@@ -383,6 +384,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/connections/ifpending',
'name' => $rr['xchan_name'],
+ 'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => relative_date($rr['abook_created']),
@@ -407,6 +409,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/admin/accounts',
'name' => $rr['account_email'],
+ 'addr' => $rr['account_email'],
'url' => '',
'photo' => z_root() . '/' . get_default_profile_photo(48),
'when' => relative_date($rr['account_created']),
@@ -444,6 +447,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/events', /// @FIXME this takes you to an edit page and it may not be yours, we really want to just view the single event --> '/events/event/' . $rr['event_hash'],
'name' => $rr['xchan_name'],
+ 'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => $when,
@@ -460,7 +464,7 @@ class Ping extends \Zotlabs\Web\Controller {
if(argc() > 1 && (argv(1) === 'files')) {
$result = array();
- $r = q("SELECT item.created, xchan.xchan_name, xchan.xchan_url, xchan.xchan_photo_s FROM item
+ $r = q("SELECT item.created, xchan.xchan_name, xchan.xchan_addr, xchan.xchan_url, xchan.xchan_photo_s FROM item
LEFT JOIN xchan on author_xchan = xchan_hash
WHERE item.verb = '%s'
AND item.obj_type = '%s'
@@ -477,6 +481,7 @@ class Ping extends \Zotlabs\Web\Controller {
$result[] = array(
'notify_link' => z_root() . '/sharedwithme',
'name' => $rr['xchan_name'],
+ 'addr' => $rr['xchan_addr'],
'url' => $rr['xchan_url'],
'photo' => $rr['xchan_photo_s'],
'when' => relative_date($rr['created']),
@@ -658,6 +663,7 @@ class Ping extends \Zotlabs\Web\Controller {
if($r[0]['unseen']) {
$forums[$x]['notify_link'] = (($forums[$x]['private_forum']) ? $forums[$x]['xchan_url'] : z_root() . '/network/?f=&pf=1&unseen=1&cid=' . $forums[$x]['abook_id']);
$forums[$x]['name'] = $forums[$x]['xchan_name'];
+ $forums[$x]['addr'] = $forums[$x]['xchan_addr'];
$forums[$x]['url'] = $forums[$x]['xchan_url'];
$forums[$x]['photo'] = $forums[$x]['xchan_photo_s'];
$forums[$x]['unseen'] = $r[0]['unseen'];
diff --git a/view/js/main.js b/view/js/main.js
index 085bc8d0d..f4bfd413b 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -544,7 +544,7 @@ function handleNotificationsItems(notifyType, data) {
notify_menu.html('');
$(data).each(function() {
- html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum);
+ html = notifications_tpl.format(this.notify_link,this.photo,this.name,this.addr,this.message,this.when,this.hclass,this.b64mid,this.notify_id,this.thread_top,this.unseen,this.private_forum);
notify_menu.append(html);
});
diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl
index f43d82301..48521c81c 100644
--- a/view/tpl/notifications_widget.tpl
+++ b/view/tpl/notifications_widget.tpl
@@ -105,8 +105,9 @@
$("#nav-{{$notification.type}}-menu .notification").each(function(i, el){
var cn = $(el).data('contact_name').toString().toLowerCase();
+ var ca = $(el).data('contact_addr').toString().toLowerCase();
- if(cn.indexOf(val) === -1)
+ if(cn.indexOf(val) === -1 && ca.indexOf(val) === -1)
$(this).addClass('d-none');
else
$(this).removeClass('d-none');
@@ -134,18 +135,18 @@
{{$no_notifications}}<span class="jumping-dots"><span class="dot-1">.</span><span class="dot-2">.</span><span class="dot-3">.</span></span>
</div>
<div id="nav-notifications-template" rel="template">
- <a class="list-group-item clearfix notification {5}" href="{0}" title="{2}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}" data-contact_name="{2}">
+ <a class="list-group-item clearfix notification {6}" href="{0}" title="{2}" data-b64mid="{7}" data-notify_id="{8}" data-thread_top="{9}" data-contact_name="{2}" data-contact_addr="{3}">
<img class="menu-img-3" data-src="{1}">
<span class="contactname">{2}</span>
- <span class="dropdown-sub-text">{3}<br>{4}</span>
+ <span class="dropdown-sub-text">{4}<br>{5}</span>
</a>
</div>
<div id="nav-notifications-forums-template" rel="template">
- <a class="list-group-item clearfix notification notification-forum" href="{0}" title="{3}" data-b64mid="{6}" data-notify_id="{7}" data-thread_top="{8}" data-contact_name="{2}">
- <span class="float-right badge badge-{{$notification.severity}}">{9}</span>
+ <a class="list-group-item clearfix notification notification-forum" href="{0}" title="{4}" data-b64mid="{7}" data-notify_id="{8}" data-thread_top="{9}" data-contact_name="{2}" data-contact-addr="{3}">
+ <span class="float-right badge badge-{{$notification.severity}}">{10}</span>
<img class="menu-img-1" data-src="{1}">
<span class="">{2}</span>
- <i class="fa fa-{10} text-muted"></i>
+ <i class="fa fa-{11} text-muted"></i>
</a>
</div>
<div id="notifications" class="navbar-nav">