api - unobscure mail
This commit is contained in:
parent
0883512e30
commit
01efda6850
@ -1588,7 +1588,7 @@ require_once('include/items.php');
|
|||||||
return($as);
|
return($as);
|
||||||
}
|
}
|
||||||
|
|
||||||
function api_format_messages($item, $recipient, $sender) {
|
function api_format_message($item, $recipient, $sender) {
|
||||||
// standard meta information
|
// standard meta information
|
||||||
$ret = array(
|
$ret = array(
|
||||||
'id' => $item['id'],
|
'id' => $item['id'],
|
||||||
@ -1600,7 +1600,7 @@ require_once('include/items.php');
|
|||||||
'recipient_screen_name' => $recipient['screen_name'],
|
'recipient_screen_name' => $recipient['screen_name'],
|
||||||
'recipient' => $recipient,
|
'recipient' => $recipient,
|
||||||
);
|
);
|
||||||
unobscure($item);
|
unobscure_mail($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'] ;
|
||||||
@ -1963,7 +1963,7 @@ require_once('include/items.php');
|
|||||||
|
|
||||||
if ($id>-1) {
|
if ($id>-1) {
|
||||||
$r = q("SELECT * FROM `mail` WHERE id=%d", intval($id));
|
$r = q("SELECT * FROM `mail` WHERE id=%d", intval($id));
|
||||||
$ret = api_format_messages($r[0], $recipient, $sender);
|
$ret = api_format_message($r[0], $recipient, $sender);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$ret = array("error"=>$id);
|
$ret = array("error"=>$id);
|
||||||
@ -2028,7 +2028,7 @@ require_once('include/items.php');
|
|||||||
$sender = $user_info;
|
$sender = $user_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
$ret[]=api_format_messages($item, $recipient, $sender);
|
$ret[]=api_format_message($item, $recipient, $sender);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1188,6 +1188,17 @@ function unobscure(&$item) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function unobscure_mail(&$item) {
|
||||||
|
if(array_key_exists('mail_flags',$item) && ($item['mail_flags'] & MAIL_OBSCURED)) {
|
||||||
|
$key = get_config('system','prvkey');
|
||||||
|
if($item['title'])
|
||||||
|
$item['title'] = crypto_unencapsulate(json_decode_plus($item['title']),$key);
|
||||||
|
if($item['body'])
|
||||||
|
$item['body'] = crypto_unencapsulate(json_decode_plus($item['body']),$key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function theme_attachments(&$item) {
|
function theme_attachments(&$item) {
|
||||||
|
|
||||||
$arr = json_decode_plus($item['attach']);
|
$arr = json_decode_plus($item['attach']);
|
||||||
|
@ -1 +1 @@
|
|||||||
2015-04-18.1006
|
2015-04-19.1007
|
||||||
|
Reference in New Issue
Block a user