aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-05-05 18:36:05 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-05-05 18:36:05 -0700
commitc9ec4f46b6177f88a41d3c3bdc11e06467101721 (patch)
tree902a5b2fbb48aa4bb4343f5e5b4afd59f8106b39 /include
parentecbe01e3f7ed878dc363c602ebb52ed06e38b91d (diff)
downloadvolse-hubzilla-c9ec4f46b6177f88a41d3c3bdc11e06467101721.tar.gz
volse-hubzilla-c9ec4f46b6177f88a41d3c3bdc11e06467101721.tar.bz2
volse-hubzilla-c9ec4f46b6177f88a41d3c3bdc11e06467101721.zip
for hubzilla we won't be obscuring items, only private mail, this will allow us to search and cache private posts
Diffstat (limited to 'include')
-rw-r--r--include/conversation.php9
-rwxr-xr-xinclude/items.php51
2 files changed, 1 insertions, 59 deletions
diff --git a/include/conversation.php b/include/conversation.php
index fb012667e..e76101cbe 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -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
// FIXME - we need a better filter than just the string 'data'; try and
diff --git a/include/items.php b/include/items.php
index 4e85bef37..7e8e6b3c2 100755
--- a/include/items.php
+++ b/include/items.php
@@ -417,14 +417,6 @@ function post_activity_item($arr) {
$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());
@@ -900,21 +892,6 @@ function get_item_elements($x) {
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)) {
// extended export encoding
@@ -2063,14 +2040,6 @@ function item_store($arr, $allow_exec = false) {
}
$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'])) {
@@ -2460,14 +2429,6 @@ function item_store_update($arr,$allow_exec = false) {
}
$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'])) {
@@ -3173,17 +3134,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent) {
$title = $item['title'];
$body = $item['body'];
- 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(! $private) {
if($flag_bits & ITEM_OBSCURED) {
$key = get_config('system','prvkey');
$flag_bits = $flag_bits ^ ITEM_OBSCURED;