aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-04 23:54:46 -0800
committerfriendica <info@friendica.com>2013-12-04 23:54:46 -0800
commitcc1e906825dd30f74d0a30190a7dd2a26d6b1642 (patch)
tree9217329af3b4751d921ffa125be1907377ea9cea
parent04f61dd4a1e2d44291265855df68521933bedb04 (diff)
downloadvolse-hubzilla-cc1e906825dd30f74d0a30190a7dd2a26d6b1642.tar.gz
volse-hubzilla-cc1e906825dd30f74d0a30190a7dd2a26d6b1642.tar.bz2
volse-hubzilla-cc1e906825dd30f74d0a30190a7dd2a26d6b1642.zip
generate a small amount of entropy to avoid duplicate notifications from essentially simultaneous deliveries.
-rw-r--r--include/enotify.php4
-rw-r--r--mod/post.php6
-rw-r--r--view/theme/redbasic/js/redbasic.js4
3 files changed, 12 insertions, 2 deletions
diff --git a/include/enotify.php b/include/enotify.php
index 808efef51..011a1cde2 100644
--- a/include/enotify.php
+++ b/include/enotify.php
@@ -4,6 +4,10 @@ function notification($params) {
logger('notification: entry', LOGGER_DEBUG);
+ // throw a small amount of entropy into the system to breakup duplicates arriving at the same precise instant.
+ usleep(mt_rand(0,10000));
+
+
$a = get_app();
diff --git a/mod/post.php b/mod/post.php
index 627e13fa0..e589378dc 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -127,7 +127,7 @@ function post_init(&$a) {
goaway($desturl);
}
- logger('mod_zot: auth request received from ' . $x[0]['xchan_addr'] );
+ logger('mod_zot: auth request received from ' . $x[0]['hubloc_addr'] );
// check credentials and access
@@ -139,7 +139,9 @@ function post_init(&$a) {
$remote_service_class = '';
$remote_hub = $x[0]['hubloc_url'];
- $already_authed = ((($remote) && ($x[0]['hubloc_hash'] == $remote)) ? true : false);
+ // Also check that they are coming from the same site as they authenticated with originally.
+
+ $already_authed = ((($remote) && ($x[0]['hubloc_hash'] == $remote) && ($x[0]['hubloc_url'] === $_SESSION['remote_hub'])) ? true : false);
if(! $already_authed) {
diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js
index 12ff2c6fe..e89c51119 100644
--- a/view/theme/redbasic/js/redbasic.js
+++ b/view/theme/redbasic/js/redbasic.js
@@ -16,6 +16,10 @@ function cmtBbClose(comment, id) {
return false;
}
+//document.jotpermslock = 'icon-lock';
+//document.jotpermsunlock = 'icon-unlock';
+
+
$(document).ready(function() {
$('.group-edit-icon').hover(