aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-10-14 13:11:24 -0700
committerredmatrix <redmatrix@redmatrix.me>2015-10-14 13:11:24 -0700
commit732c6134ddfc6bb1df191c7967069e008d85acfb (patch)
tree67085cf722d107e4fbde772931591935f5505f03 /include/items.php
parent578f1b8ece49c6b8aa8eb34e33f37f456d5a4d90 (diff)
downloadvolse-hubzilla-732c6134ddfc6bb1df191c7967069e008d85acfb.tar.gz
volse-hubzilla-732c6134ddfc6bb1df191c7967069e008d85acfb.tar.bz2
volse-hubzilla-732c6134ddfc6bb1df191c7967069e008d85acfb.zip
support for mail sync
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php26
1 files changed, 25 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index eed9dabb2..54dcf2b51 100755
--- a/include/items.php
+++ b/include/items.php
@@ -1561,7 +1561,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';
@@ -1595,6 +1595,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;
}
@@ -1619,6 +1631,18 @@ function get_mail_elements($x) {
if(in_array('recalled',$x['flags'])) {
$arr['mail_flags'] |= MAIL_RECALLED;
}
+ 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');