for hubzilla we won't be obscuring items, only private mail, this will allow us to search and cache private posts
This commit is contained in:
parent
ecbe01e3f7
commit
c9ec4f46b6
@ -356,15 +356,6 @@ function localize_item(&$item){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
// add sparkle links to appropriate permalinks
|
|
||||||
|
|
||||||
// $x = stristr($item['plink'],'/display/');
|
|
||||||
// if($x) {
|
|
||||||
// $sparkle = false;
|
|
||||||
// $y = best_link_url($item,$sparkle,true);
|
|
||||||
// if($sparkle)
|
|
||||||
// $item['plink'] = $y . '?f=&url=' . $item['plink'];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if item body was obscured and we changed it, re-obscure it
|
// if item body was obscured and we changed it, re-obscure it
|
||||||
// FIXME - we need a better filter than just the string 'data'; try and
|
// FIXME - we need a better filter than just the string 'data'; try and
|
||||||
|
@ -417,14 +417,6 @@ function post_activity_item($arr) {
|
|||||||
$arr['item_flags'] = $arr['item_flags'] | ITEM_VERIFIED;
|
$arr['item_flags'] = $arr['item_flags'] | ITEM_VERIFIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger('Encrypting local storage');
|
|
||||||
$key = get_config('system','pubkey');
|
|
||||||
$arr['item_flags'] = $arr['item_flags'] | ITEM_OBSCURED;
|
|
||||||
if($arr['title'])
|
|
||||||
$arr['title'] = json_encode(crypto_encapsulate($arr['title'],$key));
|
|
||||||
if($arr['body'])
|
|
||||||
$arr['body'] = json_encode(crypto_encapsulate($arr['body'],$key));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$arr['mid'] = ((x($arr,'mid')) ? $arr['mid'] : item_message_id());
|
$arr['mid'] = ((x($arr,'mid')) ? $arr['mid'] : item_message_id());
|
||||||
@ -900,21 +892,6 @@ function get_item_elements($x) {
|
|||||||
logger('get_item_elements: message verification failed.');
|
logger('get_item_elements: message verification failed.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// if it's a private post, encrypt it in the DB.
|
|
||||||
// We have to do that here because we need to cleanse the input and prevent bad stuff from getting in,
|
|
||||||
// and we need plaintext to do that.
|
|
||||||
|
|
||||||
|
|
||||||
if(intval($arr['item_private'])) {
|
|
||||||
$arr['item_flags'] = $arr['item_flags'] | ITEM_OBSCURED;
|
|
||||||
if($arr['title'])
|
|
||||||
$arr['title'] = json_encode(crypto_encapsulate($arr['title'],$key));
|
|
||||||
if($arr['body'])
|
|
||||||
$arr['body'] = json_encode(crypto_encapsulate($arr['body'],$key));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(array_key_exists('revision',$x)) {
|
if(array_key_exists('revision',$x)) {
|
||||||
// extended export encoding
|
// extended export encoding
|
||||||
|
|
||||||
@ -2063,14 +2040,6 @@ function item_store($arr, $allow_exec = false) {
|
|||||||
}
|
}
|
||||||
$arr = $translate['item'];
|
$arr = $translate['item'];
|
||||||
}
|
}
|
||||||
if($arr['item_private']) {
|
|
||||||
$key = get_config('system','pubkey');
|
|
||||||
$arr['item_flags'] = $arr['item_flags'] | ITEM_OBSCURED;
|
|
||||||
if($arr['title'])
|
|
||||||
$arr['title'] = json_encode(crypto_encapsulate($arr['title'],$key));
|
|
||||||
if($arr['body'])
|
|
||||||
$arr['body'] = json_encode(crypto_encapsulate($arr['body'],$key));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((x($arr,'object')) && is_array($arr['object'])) {
|
if((x($arr,'object')) && is_array($arr['object'])) {
|
||||||
@ -2460,14 +2429,6 @@ function item_store_update($arr,$allow_exec = false) {
|
|||||||
}
|
}
|
||||||
$arr = $translate['item'];
|
$arr = $translate['item'];
|
||||||
}
|
}
|
||||||
if($arr['item_private']) {
|
|
||||||
$key = get_config('system','pubkey');
|
|
||||||
$arr['item_flags'] = $arr['item_flags'] | ITEM_OBSCURED;
|
|
||||||
if($arr['title'])
|
|
||||||
$arr['title'] = json_encode(crypto_encapsulate($arr['title'],$key));
|
|
||||||
if($arr['body'])
|
|
||||||
$arr['body'] = json_encode(crypto_encapsulate($arr['body'],$key));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if((x($arr,'object')) && is_array($arr['object'])) {
|
if((x($arr,'object')) && is_array($arr['object'])) {
|
||||||
@ -3173,17 +3134,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent) {
|
|||||||
$title = $item['title'];
|
$title = $item['title'];
|
||||||
$body = $item['body'];
|
$body = $item['body'];
|
||||||
|
|
||||||
if($private) {
|
if(! $private) {
|
||||||
if(!($flag_bits & ITEM_OBSCURED)) {
|
|
||||||
$key = get_config('system','pubkey');
|
|
||||||
$flag_bits = $flag_bits|ITEM_OBSCURED;
|
|
||||||
if($title)
|
|
||||||
$title = json_encode(crypto_encapsulate($title,$key));
|
|
||||||
if($body)
|
|
||||||
$body = json_encode(crypto_encapsulate($body,$key));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if($flag_bits & ITEM_OBSCURED) {
|
if($flag_bits & ITEM_OBSCURED) {
|
||||||
$key = get_config('system','prvkey');
|
$key = get_config('system','prvkey');
|
||||||
$flag_bits = $flag_bits ^ ITEM_OBSCURED;
|
$flag_bits = $flag_bits ^ ITEM_OBSCURED;
|
||||||
|
@ -790,14 +790,6 @@ function item_post(&$a) {
|
|||||||
$datarray['item_flags'] = $datarray['item_flags'] | ITEM_VERIFIED;
|
$datarray['item_flags'] = $datarray['item_flags'] | ITEM_VERIFIED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logger('Encrypting local storage');
|
|
||||||
$key = get_config('system','pubkey');
|
|
||||||
$datarray['item_flags'] = $datarray['item_flags'] | ITEM_OBSCURED;
|
|
||||||
if($datarray['title'])
|
|
||||||
$datarray['title'] = json_encode(crypto_encapsulate($datarray['title'],$key));
|
|
||||||
if($datarray['body'])
|
|
||||||
$datarray['body'] = json_encode(crypto_encapsulate($datarray['body'],$key));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($orig_post) {
|
if($orig_post) {
|
||||||
|
Reference in New Issue
Block a user