issues with diaspora comment signatures on relayed comments that are relayed through a redmatrix site (parent post is redmatrix) and involve a private post.
This commit is contained in:
parent
baa0b0f393
commit
16b94f1dc0
@ -2604,6 +2604,9 @@ function diaspora_send_relay($item,$owner,$contact,$public_batch = false) {
|
||||
|
||||
$parentauthorsig = base64_encode(rsa_sign($sender_signed_text,$owner['channel_prvkey'],'sha256'));
|
||||
|
||||
if(! $text)
|
||||
logger('diaspora_send_relay: no text');
|
||||
|
||||
$msg = replace_macros($tpl,array(
|
||||
'$guid' => xmlify($item['mid']),
|
||||
'$parent_guid' => xmlify($parent['mid']),
|
||||
|
@ -537,6 +537,17 @@ function identity_basic_export($channel_id, $items = false) {
|
||||
$ret['photo'] = array('type' => $r[0]['type'], 'data' => base64url_encode($r[0]['data']));
|
||||
}
|
||||
|
||||
|
||||
// All other term types will be included in items, if requested.
|
||||
|
||||
$r = q("select * from term where type in (%d,%d) and uid = %d",
|
||||
intval(TERM_SAVEDSEARCH),
|
||||
intval(TERM_THING),
|
||||
intval($channel_id)
|
||||
);
|
||||
if($r)
|
||||
$ret['term'] = $r;
|
||||
|
||||
$r = q("select * from obj where obj_channel = %d",
|
||||
intval($channel_id)
|
||||
);
|
||||
|
@ -759,6 +759,8 @@ function get_item_elements($x) {
|
||||
$arr = array();
|
||||
$arr['body'] = (($x['body']) ? htmlspecialchars($x['body'],ENT_COMPAT,'UTF-8',false) : '');
|
||||
|
||||
$key = get_config('system','pubkey');
|
||||
|
||||
$maxlen = get_max_import_size();
|
||||
|
||||
if($maxlen && mb_strlen($arr['body']) > $maxlen) {
|
||||
@ -813,7 +815,7 @@ function get_item_elements($x) {
|
||||
|
||||
$arr['sig'] = (($x['signature']) ? htmlspecialchars($x['signature'], ENT_COMPAT,'UTF-8',false) : '');
|
||||
|
||||
$arr['diaspora_meta'] = (($x['diaspora_meta']) ? $x['diaspora_meta'] : '');
|
||||
$arr['diaspora_meta'] = (($x['diaspora_signature']) ? json_encode(crypto_encapsulate($x['diaspora_signature'],$key)) : '');
|
||||
$arr['object'] = activity_sanitise($x['object']);
|
||||
$arr['target'] = activity_sanitise($x['target']);
|
||||
|
||||
@ -865,7 +867,6 @@ function get_item_elements($x) {
|
||||
// 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.
|
||||
|
||||
$key = get_config('system','pubkey');
|
||||
|
||||
|
||||
if(intval($arr['item_private'])) {
|
||||
@ -891,7 +892,6 @@ function get_item_elements($x) {
|
||||
$arr['resource_type'] = $x['resource_type'];
|
||||
$arr['item_restrict'] = $x['item_restrict'];
|
||||
$arr['item_flags'] = $x['item_flags'];
|
||||
$arr['diaspora_meta'] = (($x['diaspora_meta']) ? json_encode(crypto_encapsulate($x['diaspora_meta'],$key)) : '');
|
||||
$arr['attach'] = $x['attach'];
|
||||
|
||||
}
|
||||
@ -1078,7 +1078,6 @@ function encode_item($item,$mirror = false) {
|
||||
$x['resource_type'] = $item['resource_type'];
|
||||
$x['item_restrict'] = $item['item_restrict'];
|
||||
$x['item_flags'] = $item['item_flags'];
|
||||
$x['diaspora_meta'] = crypto_unencapsulate(json_decode($item['diaspora_meta'],true),$key);
|
||||
$x['attach'] = $item['attach'];
|
||||
}
|
||||
|
||||
@ -1127,6 +1126,9 @@ function encode_item($item,$mirror = false) {
|
||||
if($item['term'])
|
||||
$x['tags'] = encode_item_terms($item['term']);
|
||||
|
||||
if($item['diaspora_meta'])
|
||||
$x['diaspora_signature'] = crypto_unencapsulate(json_decode($item['diaspora_meta'],true),$key);
|
||||
|
||||
logger('encode_item: ' . print_r($x,true), LOGGER_DATA);
|
||||
|
||||
return $x;
|
||||
|
@ -67,8 +67,6 @@ function thing_init(&$a) {
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if($term_hash) {
|
||||
$t = q("select * from obj left join term on obj_obj = term_hash where term_hash != '' and obj_type = %d and term_hash = '%s' limit 1",
|
||||
intval(TERM_OBJ_THING),
|
||||
|
@ -1 +1 @@
|
||||
2014-10-01.815
|
||||
2014-10-02.816
|
||||
|
Reference in New Issue
Block a user