more work on viewing obscured api posts
This commit is contained in:
parent
c6d6c01fb6
commit
a78b76d393
@ -730,7 +730,8 @@ require_once('include/photos.php');
|
|||||||
$in_reply_to_user_id = $user_info['id'];
|
$in_reply_to_user_id = $user_info['id'];
|
||||||
$in_reply_to_screen_name = $user_info['screen_name'];
|
$in_reply_to_screen_name = $user_info['screen_name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
unobscure($lastwall);
|
||||||
$status_info = array(
|
$status_info = array(
|
||||||
'text' => html2plain(prepare_text($lastwall['body'],$lastwall['mimetype']), 0),
|
'text' => html2plain(prepare_text($lastwall['body'],$lastwall['mimetype']), 0),
|
||||||
'truncated' => false,
|
'truncated' => false,
|
||||||
@ -803,6 +804,7 @@ require_once('include/photos.php');
|
|||||||
$in_reply_to_screen_name = $user_info['screen_name'];
|
$in_reply_to_screen_name = $user_info['screen_name'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
unobscure($lastwall);
|
||||||
$user_info['status'] = array(
|
$user_info['status'] = array(
|
||||||
'text' => html2plain(prepare_text($lastwall['body'],$lastwall['mimetype']), 0),
|
'text' => html2plain(prepare_text($lastwall['body'],$lastwall['mimetype']), 0),
|
||||||
'truncated' => false,
|
'truncated' => false,
|
||||||
@ -1369,7 +1371,7 @@ require_once('include/photos.php');
|
|||||||
'recipient_screen_name' => $recipient['screen_name'],
|
'recipient_screen_name' => $recipient['screen_name'],
|
||||||
'recipient' => $recipient,
|
'recipient' => $recipient,
|
||||||
);
|
);
|
||||||
|
unobscure($item);
|
||||||
//don't send title to regular StatusNET requests to avoid confusing these apps
|
//don't send title to regular StatusNET requests to avoid confusing these apps
|
||||||
if (x($_GET, 'getText')) {
|
if (x($_GET, 'getText')) {
|
||||||
$ret['title'] = $item['title'] ;
|
$ret['title'] = $item['title'] ;
|
||||||
@ -1425,7 +1427,7 @@ require_once('include/photos.php');
|
|||||||
$in_reply_to_user_id = 0;
|
$in_reply_to_user_id = 0;
|
||||||
$in_reply_to_status_id = 0;
|
$in_reply_to_status_id = 0;
|
||||||
}
|
}
|
||||||
|
unobscure($item);
|
||||||
// Workaround for ostatus messages where the title is identically to the body
|
// Workaround for ostatus messages where the title is identically to the body
|
||||||
$statusbody = trim(html2plain(prepare_text($item['body'],$item['mimetype']), 0));
|
$statusbody = trim(html2plain(prepare_text($item['body'],$item['mimetype']), 0));
|
||||||
$statustitle = trim($item['title']);
|
$statustitle = trim($item['title']);
|
||||||
|
@ -1004,6 +1004,17 @@ function link_compare($a,$b) {
|
|||||||
// If attach is true, also add icons for item attachments
|
// If attach is true, also add icons for item attachments
|
||||||
|
|
||||||
|
|
||||||
|
function unobscure(&$item) {
|
||||||
|
if(array_key_exists('item_flags',$item) && ($item['item_flags'] & ITEM_OBSCURED)) {
|
||||||
|
$key = get_config('system','prvkey');
|
||||||
|
if($item['title'])
|
||||||
|
$item['title'] = aes_unencapsulate(json_decode_plus($item['title']),$key);
|
||||||
|
if($item['body'])
|
||||||
|
$item['body'] = aes_unencapsulate(json_decode_plus($item['body']),$key);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function prepare_body(&$item,$attach = false) {
|
function prepare_body(&$item,$attach = false) {
|
||||||
|
|
||||||
@ -1013,13 +1024,7 @@ function prepare_body(&$item,$attach = false) {
|
|||||||
|
|
||||||
call_hooks('prepare_body_init', $item);
|
call_hooks('prepare_body_init', $item);
|
||||||
|
|
||||||
if(array_key_exists('item_flags',$item) && ($item['item_flags'] & ITEM_OBSCURED)) {
|
unobscure($item);
|
||||||
$key = get_config('system','prvkey');
|
|
||||||
if($item['title'])
|
|
||||||
$item['title'] = aes_unencapsulate(json_decode_plus($item['title']),$key);
|
|
||||||
if($item['body'])
|
|
||||||
$item['body'] = aes_unencapsulate(json_decode_plus($item['body']),$key);
|
|
||||||
}
|
|
||||||
|
|
||||||
$s = prepare_text($item['body'],$item['mimetype']);
|
$s = prepare_text($item['body'],$item['mimetype']);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user