some work on issue #329

This commit is contained in:
redmatrix 2015-05-25 19:17:35 -07:00
parent 29a8d580be
commit 9a0264f5d2
4 changed files with 11 additions and 8 deletions

View File

@ -24,8 +24,9 @@ function diaspora_dispatch_public($msg) {
// find everybody following or allowing this author
$r = q("SELECT * from channel where channel_id in ( SELECT abook_channel from abook left join xchan on abook_xchan = xchan_hash WHERE xchan_network like '%%diaspora%%' and xchan_addr = '%s' )",
dbesc($msg['author'])
$r = q("SELECT * from channel where channel_id in ( SELECT abook_channel from abook left join xchan on abook_xchan = xchan_hash WHERE xchan_network like '%%diaspora%%' and xchan_addr = '%s' ) and ( channel_pageflags & %d ) = 0 ",
dbesc($msg['author']),
intval(PAGE_REMOVED)
);
// also need to look for those following public streams

View File

@ -621,8 +621,9 @@ function profile_load(&$a, $nickname, $profile = '') {
logger('profile_load: ' . $nickname . (($profile) ? ' profile: ' . $profile : ''));
$user = q("select channel_id from channel where channel_address = '%s' limit 1",
dbesc($nickname)
$user = q("select channel_id from channel where channel_address = '%s' and not ( channel_pageflags & %d ) > 0 limit 1",
dbesc($nickname),
intval(PAGE_REMOVED)
);
if(! $user) {

View File

@ -1114,7 +1114,7 @@ function zot_import($arr, $sender_url) {
}
stringify_array_elms($recip_arr);
$recips = implode(',',$recip_arr);
$r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and not ( channel_pageflags & %d )>0 ",
$r = q("select channel_hash as hash from channel where channel_hash in ( " . $recips . " ) and not ( channel_pageflags & %d ) > 0 ",
intval(PAGE_REMOVED)
);
if(! $r) {
@ -1378,7 +1378,8 @@ function public_recips($msg) {
if(($tag['type'] === 'mention') && (strpos($tag['url'],z_root()) !== false)) {
$address = basename($tag['url']);
if($address) {
$z = q("select channel_hash as hash from channel where channel_address = '%s' limit 1",
$z = q("select channel_hash as hash from channel where channel_address = '%s'
and ( channel_pageflags & " . intval(PAGE_REMOVED) . " ) = 0 limit 1",
dbesc($address)
);
if($z)
@ -1482,7 +1483,7 @@ function allowed_public_recips($msg) {
$condensed_recips[] = $rr['hash'];
$results = array();
$r = q("select channel_hash as hash from channel left join abook on abook_channel = channel_id where abook_xchan = '%s' and not ( channel_pageflags & %d ) > 0 ",
$r = q("select channel_hash as hash from channel left join abook on abook_channel = channel_id where abook_xchan = '%s' and ( channel_pageflags & %d ) = 0 ",
dbesc($hash),
intval(PAGE_REMOVED)
);

View File

@ -31,7 +31,7 @@ function receive_post(&$a) {
// Diaspora sites *may* provide a truncated guid.
$r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_guid like '%s' AND NOT (channel_pageflags & %d )>0 LIMIT 1",
$r = q("SELECT * FROM channel left join xchan on channel_hash = xchan_hash WHERE channel_guid like '%s' AND (channel_pageflags & %d ) = 0 LIMIT 1",
dbesc($guid . '%'),
intval(PAGE_REMOVED)
);