diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-10-14 13:13:12 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-10-14 13:13:12 -0700 |
commit | c7637a0c5394ae04c8abf1281043ca717a75e1cd (patch) | |
tree | 5699e7b2a0a24b2d2638672568fc359556287af0 /include/items.php | |
parent | 64cdbb8e3bbec5f81ccd755744a419a6c7f2434b (diff) | |
parent | 9b1195c8964013f4f8ffe7efea75d569513b83f5 (diff) | |
download | volse-hubzilla-c7637a0c5394ae04c8abf1281043ca717a75e1cd.tar.gz volse-hubzilla-c7637a0c5394ae04c8abf1281043ca717a75e1cd.tar.bz2 volse-hubzilla-c7637a0c5394ae04c8abf1281043ca717a75e1cd.zip |
Merge https://github.com/redmatrix/redmatrix into pending_merge
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php index e7cc02579..e69e83b83 100755 --- a/include/items.php +++ b/include/items.php @@ -1559,7 +1559,7 @@ function encode_item_flags($item) { return $ret; } -function encode_mail($item) { +function encode_mail($item,$extended = false) { $x = array(); $x['type'] = 'mail'; $x['encoding'] = 'zot'; @@ -1592,6 +1592,18 @@ function encode_mail($item) { $x['body'] = ''; } + if($extended) { + $x['conv_guid'] = $item['conv_guid']; + if($item['mail_flags'] & MAIL_DELETED) + $x['flags'][] = 'deleted'; + if($item['mail_flags'] & MAIL_REPLIED) + $x['flags'][] = 'replied'; + if($item['mail_flags'] & MAIL_ISREPLY) + $x['flags'][] = 'isreply'; + if($item['mail_flags'] & MAIL_SEEN) + $x['flags'][] = 'seen'; + } + return $x; } @@ -1616,6 +1628,18 @@ function get_mail_elements($x) { if(in_array('recalled',$x['flags'])) { $arr['mail_recalled'] = 1; } + if(in_array('replied',$x['flags'])) { + $arr['mail_flags'] |= MAIL_REPLIED; + } + if(in_array('isreply',$x['flags'])) { + $arr['mail_flags'] |= MAIL_ISREPLY; + } + if(in_array('seen',$x['flags'])) { + $arr['mail_flags'] |= MAIL_SEEN; + } + if(in_array('deleted',$x['flags'])) { + $arr['mail_flags'] |= MAIL_DELETED; + } } $key = get_config('system','pubkey'); |