aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-02 03:38:53 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-02 03:38:53 -0700
commit336aea26dc398dd38ff121c6b7d3b9559fcc8701 (patch)
treeb61c492b2d91145e927cdaf0186ace2efca1b252 /include/notifier.php
parent6ad1a22a055f58c09d44d4da9750f6de2d478fe7 (diff)
downloadvolse-hubzilla-336aea26dc398dd38ff121c6b7d3b9559fcc8701.tar.gz
volse-hubzilla-336aea26dc398dd38ff121c6b7d3b9559fcc8701.tar.bz2
volse-hubzilla-336aea26dc398dd38ff121c6b7d3b9559fcc8701.zip
notify hub only on public updates
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 0166d0b37..f7d2844c3 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -60,12 +60,12 @@
if(! count($r))
killme();
- $parent = $r[0]['parent'];
+ $parent_id = $r[0]['parent'];
$uid = $r[0]['uid'];
$updated = $r[0]['edited'];
$items = q("SELECT * FROM `item` WHERE `parent` = %d ORDER BY `id` ASC",
- intval($parent)
+ intval($parent_id)
);
if(! count($items))
@@ -84,6 +84,8 @@
killme();
$hub = get_config('system','huburl');
+ // If this is a public conversation, notify the feed hub
+ $notify_hub = true;
if($cmd != 'mail') {
@@ -94,11 +96,18 @@
if($parent['type'] === 'remote') {
// local followup to remote post
$followup = true;
+ $notify_hub = false; // not public
$conversant_str = dbesc($parent['contact-id']);
}
else {
$followup = false;
+ if((strlen($parent['allow_cid']))
+ || (strlen($parent['allow_gid']))
+ || (strlen($parent['deny_cid']))
+ || (strlen($parent['deny_gid'])))
+ $notify_hub = false; // private recipients, not public
+
$allow_people = expand_acl($parent['allow_cid']);
$allow_groups = expand_groups(expand_acl($parent['allow_gid']));
$deny_people = expand_acl($parent['deny_cid']);
@@ -158,6 +167,7 @@
));
if($cmd === 'mail') {
+ $notify_hub = false; // mail is not public
$atom .= replace_macros($mail_template, array(
'$name' => xmlify($owner['name']),
'$profile_page' => xmlify($owner['url']),
@@ -302,7 +312,7 @@
}
}
- if((strlen($hub)) && ($cmd !== 'mail') && ($followup == false)) {
+ if((strlen($hub)) && ($notify_hub)) {
$params = 'hub.mode=publish&hub.url=' . urlencode($a->get_baseurl() . '/dfrn_poll/' . $owner['nickname'] );
post_url($hub,$params);
}