aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-26 17:38:44 -0700
committerredmatrix <git@macgirvin.com>2016-04-26 17:38:44 -0700
commita67fa2651d3fe4016ba8cc5f0eb90bf3993fb028 (patch)
tree6932350659fa9b2948b54adf7f50e363b9ef6db9 /include/notifier.php
parent509f25e46a37d7fae1a2d1934c6143e96aa6497d (diff)
downloadvolse-hubzilla-a67fa2651d3fe4016ba8cc5f0eb90bf3993fb028.tar.gz
volse-hubzilla-a67fa2651d3fe4016ba8cc5f0eb90bf3993fb028.tar.bz2
volse-hubzilla-a67fa2651d3fe4016ba8cc5f0eb90bf3993fb028.zip
implement the singleton delivery stuff
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 4435c7497..f0c6d7275 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -118,7 +118,7 @@ function notifier_run($argv, $argc){
$normal_mode = true;
$packet_type = 'undefined';
- if($cmd === 'mail') {
+ if($cmd === 'mail' || $cmd === 'single_mail') {
$normal_mode = false;
$mail = true;
$private = true;
@@ -280,7 +280,7 @@ function notifier_run($argv, $argc){
logger('notifier: target item not forwardable: type ' . $target_item['item_type'], LOGGER_DEBUG);
return;
}
- if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed'])) {
+ if(intval($target_item['item_unpublished']) || intval($target_item['item_delayed']) || intval($target_item['item_hidden'])) {
logger('notifier: target item not published, so not forwardable', LOGGER_DEBUG);
return;
}
@@ -454,6 +454,7 @@ function notifier_run($argv, $argc){
'uplink' => $uplink,
'cmd' => $cmd,
'mail' => $mail,
+ 'single' => (($cmd === 'single_mail' || $cmd === 'single_activity') ? true : false),
'location' => $location,
'request' => $request,
'normal_mode' => $normal_mode,
@@ -550,6 +551,7 @@ function notifier_run($argv, $argc){
'uplink' => $uplink,
'cmd' => $cmd,
'mail' => $mail,
+ 'single' => (($cmd === 'single_mail' || $cmd === 'single_activity') ? true : false),
'location' => $location,
'request' => $request,
'normal_mode' => $normal_mode,
@@ -568,6 +570,19 @@ function notifier_run($argv, $argc){
}
+ // singleton deliveries by definition 'not got zot'.
+ // Single deliveries are other federated networks (plugins) and we're essentially
+ // delivering only to those that have this site url in their abook_instance
+ // and only from within a sync operation. This means if you post from a clone,
+ // and a connection is connected to one of your other clones; assuming that hub
+ // is running it will receive a sync packet. On receipt of this sync packet it
+ // will invoke a delivery to those connections which are connected to just that
+ // hub instance.
+
+ if($cmd === 'single_mail' || $cmd === 'single_activity') {
+ continue;
+ }
+
// default: zot protocol
$hash = random_string();