Permalink
Browse files

set hidden flags on new directory entries, not just existing ones

  • Loading branch information...
1 parent 63c6427 commit abd58bce6899aff274be2e24db08cca46c4b135b @friendica committed Mar 27, 2013
Showing with 29 additions and 6 deletions.
  1. +21 −3 include/zot.php
  2. +1 −1 index.php
  3. +7 −2 mod/post.php
View
@@ -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;
View
@@ -288,7 +288,7 @@
// 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);
View
@@ -10,9 +10,9 @@
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);

0 comments on commit abd58bc

Please sign in to comment.