aboutsummaryrefslogtreecommitdiffstats
path: root/include/notifier.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/notifier.php')
-rw-r--r--include/notifier.php26
1 files changed, 10 insertions, 16 deletions
diff --git a/include/notifier.php b/include/notifier.php
index 06ef7bc94..6a6879ebb 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -206,11 +206,9 @@ function notifier_run($argv, $argc){
$normal_mode = false;
$expire = true;
- $items = q("SELECT * FROM item WHERE uid = %d AND ( item_flags & %d )>0
- AND ( item_restrict & %d )>0 AND `changed` > %s - INTERVAL %s",
+ $items = q("SELECT * FROM item WHERE uid = %d AND item_wall = 1
+ AND item_deleted = 1 AND `changed` > %s - INTERVAL %s",
intval($item_id),
- intval(ITEM_WALL),
- intval(ITEM_DELETED),
db_utcnow(), db_quoteinterval('10 MINUTE')
);
$uid = $item_id;
@@ -315,7 +313,7 @@ function notifier_run($argv, $argc){
$target_item = $r[0];
- if($target_item['item_restrict'] & ITEM_DELETED)
+ if(intval($target_item['item_deleted']))
logger('notifier: target item ITEM_DELETED', LOGGER_DEBUG);
$unforwardable = ITEM_UNPUBLISHED|ITEM_DELAYED_PUBLISH|ITEM_WEBPAGE|ITEM_BUILDBLOCK|ITEM_PDL;
@@ -362,7 +360,7 @@ function notifier_run($argv, $argc){
$encoded_item = encode_item($target_item);
- $relay_to_owner = (((! $top_level_post) && ($target_item['item_flags'] & ITEM_ORIGIN)) ? true : false);
+ $relay_to_owner = (((! $top_level_post) && (intval($target_item['item_origin']))) ? true : false);
$uplink = false;
@@ -371,11 +369,10 @@ function notifier_run($argv, $argc){
logger('notifier: relay_to_owner: ' . (($relay_to_owner) ? 'true' : 'false'), LOGGER_DATA);
logger('notifier: top_level_post: ' . (($top_level_post) ? 'true' : 'false'), LOGGER_DATA);
- logger('notifier: target_item_flags: ' . $target_item['item_flags'] . ' ' . (($target_item['item_flags'] & ITEM_ORIGIN ) ? 'true' : 'false'), LOGGER_DATA);
// tag_deliver'd post which needs to be sent back to the original author
- if(($cmd === 'uplink') && ($parent_item['item_flags'] & ITEM_UPLINK) && (! $top_level_post)) {
+ if(($cmd === 'uplink') && intval($parent_item['item_uplink']) && (! $top_level_post)) {
logger('notifier: uplink');
$uplink = true;
}
@@ -396,7 +393,7 @@ function notifier_run($argv, $argc){
// if our parent is a tag_delivery recipient, uplink to the original author causing
// a delivery fork.
- if(($parent_item['item_flags'] & ITEM_UPLINK) && (! $top_level_post) && ($cmd !== 'uplink')) {
+ if(intval($parent_item['item_uplink']) && (! $top_level_post) && ($cmd !== 'uplink')) {
logger('notifier: uplinking this item');
proc_run('php','include/notifier.php','uplink',$item_id);
}
@@ -409,7 +406,7 @@ function notifier_run($argv, $argc){
// don't send deletions onward for other people's stuff
// TODO verify this is needed - copied logic from same place in old code
- if(($target_item['item_restrict'] & ITEM_DELETED) && (!($target_item['item_flags'] & ITEM_WALL))) {
+ if(intval($target_item['item_deleted']) && (! intval($target_item['item_wall']))) {
logger('notifier: ignoring delete notification for non-wall item');
return;
}
@@ -493,15 +490,12 @@ function notifier_run($argv, $argc){
// aren't the owner or author.
- $r = q("select hubloc_guid, hubloc_url, hubloc_sitekey, hubloc_network, hubloc_flags, hubloc_callback, hubloc_host from hubloc
+ $r = q("select * from hubloc
where hubloc_hash in (" . implode(',',$recipients) . ") order by hubloc_connected desc limit 1");
}
else {
- $r = q("select hubloc_guid, hubloc_url, hubloc_sitekey, hubloc_network, hubloc_flags, hubloc_callback, hubloc_host from hubloc
- where hubloc_hash in (" . implode(',',$recipients) . ") and not (hubloc_flags & %d) > 0 and not (hubloc_status & %d) > 0",
- intval(HUBLOC_FLAGS_DELETED),
- intval(HUBLOC_OFFLINE)
- );
+ $r = q("select * from hubloc where hubloc_hash in (" . implode(',',$recipients) . ")
+ and hubloc_error = 0 and hubloc_deleted = 0");
}
if(! $r) {