aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzotlabs <mike@macgirvin.com>2018-04-11 17:44:51 -0700
committerzotlabs <mike@macgirvin.com>2018-04-11 17:44:51 -0700
commit953a2fd9b2db0c0f0b1cf54c766a1e39002eaea8 (patch)
treeae1e1d45d6c7f43db0686aec4f32bdfc33286ff2
parent2fa9645dfc4dc640d7460f069fc9536cce1e4fd2 (diff)
parent3bd645033330c2db0952e57db1516274487c0712 (diff)
downloadvolse-hubzilla-953a2fd9b2db0c0f0b1cf54c766a1e39002eaea8.tar.gz
volse-hubzilla-953a2fd9b2db0c0f0b1cf54c766a1e39002eaea8.tar.bz2
volse-hubzilla-953a2fd9b2db0c0f0b1cf54c766a1e39002eaea8.zip
Merge branch 'dev' of https://github.com/redmatrix/hubzilla into xdev_merge
-rw-r--r--Zotlabs/Lib/Enotify.php5
-rw-r--r--Zotlabs/Module/Ping.php13
-rw-r--r--Zotlabs/Module/Settings/Channel.php5
-rwxr-xr-xboot.php1
-rw-r--r--view/js/main.js3
-rwxr-xr-xview/tpl/jot-header.tpl2
-rwxr-xr-xview/tpl/settings.tpl1
7 files changed, 24 insertions, 6 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php
index 61c98c881..e05d391f3 100644
--- a/Zotlabs/Lib/Enotify.php
+++ b/Zotlabs/Lib/Enotify.php
@@ -115,6 +115,7 @@ class Enotify {
$always_show_in_notices = get_pconfig($recip['channel_id'],'system','always_show_in_notices');
+ $vnotify = get_pconfig($recip['channel_id'],'system','vnotify');
// e.g. "your post", "David's photo", etc.
$possess_desc = t('%s <!item_type!>');
@@ -142,7 +143,7 @@ class Enotify {
if(array_key_exists('item',$params) && in_array($params['item']['verb'], [ACTIVITY_LIKE, ACTIVITY_DISLIKE])) {
- if(! $always_show_in_notices) {
+ if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
@@ -249,7 +250,7 @@ class Enotify {
$itemlink = $params['link'];
if (array_key_exists('item',$params) && (! activity_match($params['item']['verb'],ACTIVITY_LIKE))) {
- if(! $always_show_in_notices) {
+ if(! $always_show_in_notices || !($vnotify & VNOTIFY_LIKE)) {
logger('notification: not a visible activity. Ignoring.');
pop_lang();
return;
diff --git a/Zotlabs/Module/Ping.php b/Zotlabs/Module/Ping.php
index 55ce40929..9372866d7 100644
--- a/Zotlabs/Module/Ping.php
+++ b/Zotlabs/Module/Ping.php
@@ -140,6 +140,11 @@ class Ping extends \Zotlabs\Web\Controller {
db_utcnow(), db_quoteinterval('3 MINUTE')
);
+
+ $sql_extra = '';
+ if(! ($vnotify & VNOTIFY_LIKE))
+ $sql_extra = ' AND verb NOT IN ("' . dbesc(ACTIVITY_LIKE) . '", "' . dbesc(ACTIVITY_DISLIKE) . '") ';
+
$discover_tab_on = can_view_public_stream();
$notify_pubs = ((local_channel()) ? ($vnotify & VNOTIFY_PUBS) && $discover_tab_on : $discover_tab_on);
@@ -152,7 +157,8 @@ class Ping extends \Zotlabs\Web\Controller {
AND item_unseen = 1
AND author_xchan != '%s'
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
- $item_normal",
+ $item_normal
+ $sql_extra",
intval($sys['channel_id']),
dbesc(get_observer_hash())
);
@@ -161,6 +167,8 @@ class Ping extends \Zotlabs\Web\Controller {
$result['pubs'] = intval($pubs[0]['total']);
}
+
+
if((argc() > 1) && (argv(1) === 'pubs') && ($notify_pubs)) {
$sys = get_sys_channel();
$result = array();
@@ -171,6 +179,7 @@ class Ping extends \Zotlabs\Web\Controller {
AND author_xchan != '%s'
AND created > '" . datetime_convert('UTC','UTC',$_SESSION['static_loadtime']) . "'
$item_normal
+ $sql_extra
ORDER BY created DESC
LIMIT 300",
intval($sys['channel_id']),
@@ -335,6 +344,7 @@ class Ping extends \Zotlabs\Web\Controller {
AND item_unseen = 1
AND author_xchan != '%s'
$item_normal
+ $sql_extra
ORDER BY created DESC
LIMIT 300",
intval(local_channel()),
@@ -509,6 +519,7 @@ class Ping extends \Zotlabs\Web\Controller {
$r = q("SELECT id, item_wall FROM item
WHERE uid = %d and item_unseen = 1
$item_normal
+ $sql_extra
AND author_xchan != '%s'",
intval(local_channel()),
dbesc($ob_hash)
diff --git a/Zotlabs/Module/Settings/Channel.php b/Zotlabs/Module/Settings/Channel.php
index 48f3edb80..e274c9786 100644
--- a/Zotlabs/Module/Settings/Channel.php
+++ b/Zotlabs/Module/Settings/Channel.php
@@ -208,6 +208,8 @@ class Channel {
$vnotify += intval($_POST['vnotify12']);
if(x($_POST,'vnotify13'))
$vnotify += intval($_POST['vnotify13']);
+ if(x($_POST,'vnotify14'))
+ $vnotify += intval($_POST['vnotify14']);
$always_show_in_notices = x($_POST,'always_show_in_notices') ? 1 : 0;
@@ -577,8 +579,9 @@ class Channel {
'$vnotify11' => ((is_site_admin()) ? array('vnotify11', t('System Registrations'), ($vnotify & VNOTIFY_REGISTER), VNOTIFY_REGISTER, '', $yes_no) : array()),
'$vnotify12' => array('vnotify12', t('Unseen shared files'), ($vnotify & VNOTIFY_FILES), VNOTIFY_FILES, '', $yes_no),
'$vnotify13' => (($disable_discover_tab && !$site_firehose) ? array() : array('vnotify13', t('Unseen public activity'), ($vnotify & VNOTIFY_PUBS), VNOTIFY_PUBS, '', $yes_no)),
+ '$vnotify14' => array('vnotify14', t('Unseen likes and dislikes'), ($vnotify & VNOTIFY_LIKE), VNOTIFY_LIKE, '', $yes_no),
'$mailhost' => [ 'mailhost', t('Email notification hub (hostname)'), get_pconfig(local_channel(),'system','email_notify_host',\App::get_hostname()), sprintf( t('If your channel is mirrored to multiple hubs, set this to your preferred location. This will prevent duplicate email notifications. Example: %s'),\App::get_hostname()) ],
- '$always_show_in_notices' => array('always_show_in_notices', t('Also show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no),
+ '$always_show_in_notices' => array('always_show_in_notices', t('Show new wall posts, private messages and connections under Notices'), $always_show_in_notices, 1, '', $yes_no),
'$evdays' => array('evdays', t('Notify me of events this many days in advance'), $evdays, t('Must be greater than 0')),
'$basic_addon' => $plugin['basic'],
diff --git a/boot.php b/boot.php
index 051522ec3..b5de3a544 100755
--- a/boot.php
+++ b/boot.php
@@ -404,6 +404,7 @@ define ( 'VNOTIFY_INTRO', 0x0200 );
define ( 'VNOTIFY_REGISTER', 0x0400 );
define ( 'VNOTIFY_FILES', 0x0800 );
define ( 'VNOTIFY_PUBS', 0x1000 );
+define ( 'VNOTIFY_LIKE', 0x2000 );
diff --git a/view/js/main.js b/view/js/main.js
index dd7b81ad4..02f2f6a3d 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -25,13 +25,14 @@ var liveRecurse = 0;
var savedTitle = '';
var initialLoad = true;
-// Clear the session storage if we switch channel or log out
+// Clear the session and local storage if we switch channel or log out
var cache_uid = '';
if(sessionStorage.getItem('uid') !== null) {
cache_uid = sessionStorage.getItem('uid');
}
if(cache_uid !== localUser.toString()) {
sessionStorage.clear();
+ localStorage.clear();
sessionStorage.setItem('uid', localUser.toString());
}
diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl
index d6d93a863..991a4c8b1 100755
--- a/view/tpl/jot-header.tpl
+++ b/view/tpl/jot-header.tpl
@@ -626,7 +626,7 @@ $( document ).on( "click", ".wall-item-delete-link,.page-delete-link,.layout-del
initEditor();
}
} else {
- autoSaveCleanup();
+ postSaveChanges('clean');
}
$(document).on('submit', '#profile-jot-form', function() {
diff --git a/view/tpl/settings.tpl b/view/tpl/settings.tpl
index 0055fa265..d258f1992 100755
--- a/view/tpl/settings.tpl
+++ b/view/tpl/settings.tpl
@@ -145,6 +145,7 @@
{{if $vnotify13}}
{{include file="field_intcheckbox.tpl" field=$vnotify13}}
{{/if}}
+ {{include file="field_intcheckbox.tpl" field=$vnotify14}}
{{include file="field_intcheckbox.tpl" field=$always_show_in_notices}}
{{include file="field_input.tpl" field=$evdays}}
</div>