this should be better - "xchan deleted" state on remote sites only follows the xchan_flags and not the channel_pageflags; XCHAN_FLAGS_DELETED should only be set if the channel is to be removed from the entire network. As mentioned in a previous commit, channel_pageflags could be set to PAGE_REMOVED but still leave living clones on other sites.

This commit is contained in:
friendica 2014-04-07 16:10:43 -07:00
parent 7e160a7b04
commit 74029a9ee9
2 changed files with 12 additions and 14 deletions

View File

@ -632,13 +632,10 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED) {
if($adult_changed)
$new_flags = $new_flags ^ XCHAN_FLAGS_SELFCENSORED;
// $deleted = (($r[0]['xchan_flags'] & XCHAN_FLAGS_DELETED) ? true : false);
// $deleted_changed = ((intval($deleted) != intval($arr['deleted'])) ? true : false);
// if($deleted_changed)
// $new_flags = $new_flags ^ XCHAN_FLAGS_DELETED;
$deleted = (($r[0]['xchan_flags'] & XCHAN_FLAGS_DELETED) ? true : false);
$deleted_changed = ((intval($deleted) != intval($arr['deleted'])) ? true : false);
if($deleted_changed)
$new_flags = $new_flags ^ XCHAN_FLAGS_DELETED;
if(($r[0]['xchan_name_date'] != $arr['name_updated'])
|| ($r[0]['xchan_connurl'] != $arr['connections_url'])
@ -683,8 +680,8 @@ function import_xchan($arr,$ud_flags = UPDATE_FLAGS_UPDATED) {
$new_flags = 0;
if($arr['adult_content'])
$new_flags |= XCHAN_FLAGS_SELFCENSORED;
// if($arr['deleted'])
// $new_flags |= XCHAN_FLAGS_DELETED;
if(array_key_exists('deleted',$arr) && $arr['deleted'])
$new_flags |= XCHAN_FLAGS_DELETED;
$x = q("insert into xchan ( xchan_hash, xchan_guid, xchan_guid_sig, xchan_pubkey, xchan_photo_mimetype,
xchan_photo_l, xchan_addr, xchan_url, xchan_connurl, xchan_follow, xchan_connpage, xchan_name, xchan_network, xchan_photo_date, xchan_name_date, xchan_flags)

View File

@ -94,10 +94,10 @@ function zfinger_init(&$a) {
$id = $e['channel_id'];
$special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
$adult_channel = (($e['channel_pageflags'] & PAGE_ADULT) ? true : false);
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
$deleted = (($e['channel_pageflags'] & PAGE_REMOVED) ? true : false);
$special_channel = (($e['channel_pageflags'] & PAGE_PREMIUM) ? true : false);
$adult_channel = (($e['channel_pageflags'] & PAGE_ADULT) ? true : false);
$searchable = (($e['channel_pageflags'] & PAGE_HIDDEN) ? false : true);
$deleted = (($e['xchan_flags'] & XCHAN_FLAGS_DELETED) ? true : false);
if(($e['xchan_flags'] & XCHAN_FLAGS_HIDDEN) || $deleted)
$searchable = false;
@ -166,7 +166,8 @@ function zfinger_init(&$a) {
$ret['target_sig'] = $zsig;
$ret['searchable'] = $searchable;
$ret['adult_content'] = $adult_channel;
$ret['deleted'] = $deleted;
if($deleted)
$ret['deleted'] = $deleted;
// premium or other channel desiring some contact with potential followers before connecting.
// This is a template - %s will be replaced with the follow_url we discover for the return channel.