aboutsummaryrefslogtreecommitdiffstats
path: root/mod/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/post.php')
-rw-r--r--mod/post.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/mod/post.php b/mod/post.php
index c21af83e4..9e818a7e2 100644
--- a/mod/post.php
+++ b/mod/post.php
@@ -98,7 +98,7 @@ function post_init(&$a) {
// Any channel will do, providing it's currently active. We just need to have an
// identity to attach to the packet we send back. So find one.
- $c = q("select * from channel where not ( channel_pageflags & %d ) limit 1",
+ $c = q("select * from channel where not ( channel_pageflags & %d )>0 limit 1",
intval(PAGE_REMOVED)
);
@@ -612,7 +612,7 @@ function post_post(&$a) {
else
$ret['pickup'][] = array('notify' => json_decode($rr['outq_notify'],true),'message' => $x);
- $x = q("delete from outq where outq_hash = '%s' limit 1",
+ $x = q("delete from outq where outq_hash = '%s'",
dbesc($rr['outq_hash'])
);
}
@@ -659,7 +659,7 @@ function post_post(&$a) {
// Update our DB to show when we last communicated successfully with this hub
// This will allow us to prune dead hubs from using up resources
- $r = q("update hubloc set hubloc_connected = '%s' where hubloc_id = %d limit 1",
+ $r = q("update hubloc set hubloc_connected = '%s' where hubloc_id = %d",
dbesc(datetime_convert()),
intval($hub['hubloc_id'])
);
@@ -667,17 +667,17 @@ function post_post(&$a) {
// a dead hub came back to life - reset any tombstones we might have
if($hub['hubloc_status'] & HUBLOC_OFFLINE) {
- q("update hubloc set hubloc_status = (hubloc_status ^ %d) where hubloc_id = %d limit 1",
+ q("update hubloc set hubloc_status = (hubloc_status & ~%d) where hubloc_id = %d",
intval(HUBLOC_OFFLINE),
intval($hub['hubloc_id'])
);
if($r[0]['hubloc_flags'] & HUBLOC_FLAGS_ORPHANCHECK) {
- q("update hubloc set hubloc_flags = (hubloc_flags ^ %d) where hubloc_id = %d limit 1",
+ q("update hubloc set hubloc_flags = (hubloc_flags & ~%d) where hubloc_id = %d",
intval(HUBLOC_FLAGS_ORPHANCHECK),
intval($hub['hubloc_id'])
);
}
- q("update xchan set xchan_flags = (xchan_flags ^ %d) where (xchan_flags & %d) and xchan_hash = '%s' limit 1",
+ q("update xchan set xchan_flags = (xchan_flags & ~%d) where (xchan_flags & %d)>0 and xchan_hash = '%s'",
intval(XCHAN_FLAGS_ORPHAN),
intval(XCHAN_FLAGS_ORPHAN),
dbesc($hub['hubloc_hash'])
@@ -732,7 +732,9 @@ function post_post(&$a) {
$sender_hash = make_xchan_hash($arr['guid'],$arr['guid_sig']);
// garbage collect any old unused notifications
- q("delete from verify where type = 'auth' and created < UTC_TIMESTAMP() - INTERVAL 10 MINUTE");
+ q("delete from verify where type = 'auth' and created < %s - INTERVAL %s",
+ db_utcnow(), db_quoteinterval('10 MINUTE')
+ );
$y = q("select xchan_pubkey from xchan where xchan_hash = '%s' limit 1",
dbesc($sender_hash)
@@ -781,7 +783,7 @@ function post_post(&$a) {
$ret['message'] .= 'verification key not found' . EOL;
json_return_and_die($ret);
}
- $r = q("delete from verify where id = %d limit 1",
+ $r = q("delete from verify where id = %d",
intval($z[0]['id'])
);
@@ -796,6 +798,7 @@ function post_post(&$a) {
$ret['service_class'] = $u[0]['account_service_class'];
// Set "do not track" flag if this site or this channel's profile is restricted
+ // in some way
if(intval(get_config('system','block_public')))
$ret['DNT'] = true;
@@ -803,6 +806,8 @@ function post_post(&$a) {
$ret['DNT'] = true;
if(get_pconfig($c[0]['channel_id'],'system','do_not_track'))
$ret['DNT'] = true;
+ if(get_pconfig($c[0]['channel_id'],'system','hide_online_status'))
+ $ret['DNT'] = true;
json_return_and_die($ret);