diff options
author | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-08-20 08:01:30 -0700 |
---|---|---|
committer | Paolo T <tuscanhobbit@users.noreply.github.com> | 2013-08-20 08:01:30 -0700 |
commit | f3ba283613bb5bd39c0f39f96a2f91112f947923 (patch) | |
tree | 9e31515169ab9e05f763d5ac8f625b8c3672b985 /include/items.php | |
parent | add03b64985f79aa268514854e91d96b6880bb3d (diff) | |
parent | 25fdc269bed74d2f1aaeb181906f50666fca1328 (diff) | |
download | volse-hubzilla-f3ba283613bb5bd39c0f39f96a2f91112f947923.tar.gz volse-hubzilla-f3ba283613bb5bd39c0f39f96a2f91112f947923.tar.bz2 volse-hubzilla-f3ba283613bb5bd39c0f39f96a2f91112f947923.zip |
Merge pull request #1 from friendica/master
Test update of my branched Red
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php index ba0867562..10bdcb38f 100755 --- a/include/items.php +++ b/include/items.php @@ -840,6 +840,9 @@ function encode_mail($item) { $x['from'] = encode_item_xchan($item['from']); $x['to'] = encode_item_xchan($item['to']); + if($item['attach']) + $x['attach'] = json_decode_plus($item['attach']); + $x['flags'] = array(); if($item['mail_flags'] & MAIL_RECALLED) { @@ -885,6 +888,9 @@ function get_mail_elements($x) { $arr['mid'] = (($x['message_id']) ? htmlentities($x['message_id'], ENT_COMPAT,'UTF-8',false) : ''); $arr['parent_mid'] = (($x['message_parent']) ? htmlentities($x['message_parent'], ENT_COMPAT,'UTF-8',false) : ''); + if($x['attach']) + $arr['attach'] = activity_sanitise($x['attach']); + if(import_author_xchan($x['from'])) $arr['from_xchan'] = base64url_encode(hash('whirlpool',$x['from']['guid'] . $x['from']['guid_sig'], true)); @@ -2202,6 +2208,9 @@ function mail_store($arr) { if((strpos($arr['body'],'<') !== false) || (strpos($arr['body'],'>') !== false)) $arr['body'] = escape_tags($arr['body']); + if(array_key_exists('attach',$arr) && is_array($arr['attach'])) + $arr['attach'] = json_encode($arr['attach']); + $arr['account_id'] = ((x($arr,'account_id')) ? intval($arr['account_id']) : 0); $arr['mid'] = ((x($arr,'mid')) ? notags(trim($arr['mid'])) : random_string()); $arr['from_xchan'] = ((x($arr,'from_xchan')) ? notags(trim($arr['from_xchan'])) : ''); @@ -2210,6 +2219,7 @@ function mail_store($arr) { $arr['title'] = ((x($arr,'title')) ? notags(trim($arr['title'])) : ''); $arr['parent_mid'] = ((x($arr,'parent_mid')) ? notags(trim($arr['parent_mid'])) : ''); $arr['body'] = ((x($arr,'body')) ? trim($arr['body']) : ''); + $arr['mail_flags'] = ((x($arr,'mail_flags')) ? intval($arr['mail_flags']) : 0 ); |