aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-10-06 19:10:57 -0700
committerFriendika <info@friendika.com>2011-10-06 19:10:57 -0700
commit2802c142cb4c479f82bcf790c8cc6b4bda51de7b (patch)
tree9d84e1371833306d4055c2e30c9ac7fb44de69a3 /include/notifier.php
parent53efeb8d1ff2a8232baa968b2f060d79f23aa9c6 (diff)
downloadvolse-hubzilla-2802c142cb4c479f82bcf790c8cc6b4bda51de7b.tar.gz
volse-hubzilla-2802c142cb4c479f82bcf790c8cc6b4bda51de7b.tar.bz2
volse-hubzilla-2802c142cb4c479f82bcf790c8cc6b4bda51de7b.zip
local_deliver testing
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 18a0fe584..90111600a 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -453,6 +453,46 @@ function notifier_run($argv, $argc){
switch($contact['network']) {
case NETWORK_DFRN:
+
+ // perform local delivery if we are on the same site
+
+ $basepath = implode('/', array_slice(explode('/',$contact['url']),0,3));
+
+ if(link_compare($basepath,$a->get_baseurl())) {
+
+ $nickname = basename($contact['url']);
+ if($contact['issued-id'])
+ $sql_extra = sprintf(" AND `dfrn-id` = '%s' ", dbesc($contact['issued-id']));
+ else
+ $sql_extra = sprintf(" AND `issued-id` = '%s' ", dbesc($contact['dfrn-id']));
+
+ $x = q("SELECT `contact`.*, `contact`.`uid` AS `importer_uid`,
+ `contact`.`pubkey` AS `cpubkey`,
+ `contact`.`prvkey` AS `cprvkey`,
+ `contact`.`thumb` AS `thumb`,
+ `contact`.`url` as `url`,
+ `contact`.`name` as `senderName`,
+ `user`.*
+ FROM `contact`
+ LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
+ WHERE `contact`.`blocked` = 0 AND `contact`.`pending` = 0
+ AND `contact`.`network` = '%s' AND `user`.`nickname` = '%s'
+ $sql_extra
+ AND `user`.`account_expired` = 0 LIMIT 1",
+ dbesc(NETWORK_DFRN),
+ dbesc($nickname)
+ );
+
+ if(count($x)) {
+ require_once('library/simplepie/simplepie.inc');
+ logger('mod-delivery: local delivery');
+ local_delivery($x[0],$atom);
+ break;
+ }
+ }
+
+
+
logger('notifier: dfrndelivery: ' . $contact['name']);
$deliver_status = dfrn_deliver($owner,$contact,$atom);