mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:55:15 +00:00
set hidden flags on new directory entries, not just existing ones
This commit is contained in:
parent
63c6427dc4
commit
abd58bce68
3 changed files with 29 additions and 6 deletions
|
@ -523,9 +523,26 @@ function import_xchan($arr) {
|
|||
}
|
||||
else {
|
||||
$import_photos = true;
|
||||
|
||||
$dirmode = get_config('system','directory_mode');
|
||||
|
||||
if((($arr['site']['directory_mode'] === 'standalone') || ($dirmode & DIRECTORY_MODE_STANDALONE))
|
||||
&& ($arr['site']['url'] != z_root()))
|
||||
$arr['searchable'] = false;
|
||||
|
||||
$hidden = (1 - intval($arr['searchable']));
|
||||
|
||||
if($hidden)
|
||||
$new_flags = XCHAN_FLAGS_HIDDEN;
|
||||
else
|
||||
$new_flags = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
$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_name, xchan_network, xchan_photo_date, xchan_name_date)
|
||||
values ( '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s') ",
|
||||
xchan_photo_l, xchan_addr, xchan_url, xchan_connurl, xchan_name, xchan_network, xchan_photo_date, xchan_name_date, xchan_flags)
|
||||
values ( '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d) ",
|
||||
dbesc($xchan_hash),
|
||||
dbesc($arr['guid']),
|
||||
dbesc($arr['guid_sig']),
|
||||
|
@ -538,7 +555,8 @@ function import_xchan($arr) {
|
|||
dbesc($arr['name']),
|
||||
dbesc('zot'),
|
||||
dbesc($arr['photo_updated']),
|
||||
dbesc($arr['name_updated'])
|
||||
dbesc($arr['name_updated']),
|
||||
intval($new_flags)
|
||||
);
|
||||
update_modtime($xchan_hash);
|
||||
$changed = true;
|
||||
|
|
|
@ -288,7 +288,7 @@ if($a->module_loaded) {
|
|||
// If $aside_default is not False after the theme _aside() function, run the
|
||||
// module's _aside() function too
|
||||
//
|
||||
// This gives themes more control over how the left sidebar looks
|
||||
// This gives themes more control over how the sidebar looks
|
||||
|
||||
$aside_default = true;
|
||||
call_hooks($a->module . '_mod_aside',$placeholder);
|
||||
|
|
|
@ -10,9 +10,9 @@ require_once('include/zot.php');
|
|||
|
||||
function post_init(&$a) {
|
||||
|
||||
// All other access to this endpoint is via the post method.
|
||||
// Most access to this endpoint is via the post method.
|
||||
// Here we will pick out the magic auth params which arrive
|
||||
// as a get request.
|
||||
// as a get request, and the only communications to arrive this way.
|
||||
|
||||
if(argc() > 1) {
|
||||
|
||||
|
@ -150,6 +150,11 @@ function post_post(&$a) {
|
|||
|
||||
logger('mod_zot: data: ' . print_r($data,true), LOGGER_DATA);
|
||||
|
||||
/**
|
||||
* Many message packets will arrive encrypted. The existence of an 'iv' element
|
||||
* tells us we need to unencapsulate the AES-256-CBC content using the site private key
|
||||
*/
|
||||
|
||||
if(array_key_exists('iv',$data)) {
|
||||
$data = aes_unencapsulate($data,get_config('system','prvkey'));
|
||||
logger('mod_zot: decrypt1: ' . $data, LOGGER_DATA);
|
||||
|
|
Loading…
Reference in a new issue