aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2015-10-14 22:57:03 +0200
committerMario Vavti <mario@mariovavti.com>2015-10-14 22:57:03 +0200
commitb6eded11193e84bafc8918eac3566e114ee17f01 (patch)
treed6b4ef16b1c6d4732be6497c1f2061377119fd5a /include
parentc8d8ae89d769f8b650c44e1387a0c33a759be87b (diff)
parentb2d949ce9a499653bba833913084b0c1406cca7f (diff)
downloadvolse-hubzilla-b6eded11193e84bafc8918eac3566e114ee17f01.tar.gz
volse-hubzilla-b6eded11193e84bafc8918eac3566e114ee17f01.tar.bz2
volse-hubzilla-b6eded11193e84bafc8918eac3566e114ee17f01.zip
Merge branch 'master' of https://github.com/redmatrix/hubzilla
Diffstat (limited to 'include')
-rw-r--r--include/attach.php2
-rw-r--r--include/identity.php25
-rwxr-xr-xinclude/items.php26
3 files changed, 51 insertions, 2 deletions
diff --git a/include/attach.php b/include/attach.php
index 0ed1690ec..fc95e3a75 100644
--- a/include/attach.php
+++ b/include/attach.php
@@ -595,7 +595,7 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) {
}
}
else {
- $folder_hash = ((array_key_exists('folder',$args)) ? $args['folder'] : '');
+ $folder_hash = ((($arr) && array_key_exists('folder',$arr)) ? $arr['folder'] : '');
}
if((! $options) || ($options === 'import')) {
diff --git a/include/identity.php b/include/identity.php
index 47738a8fa..bb905e18f 100644
--- a/include/identity.php
+++ b/include/identity.php
@@ -631,6 +631,31 @@ function identity_basic_export($channel_id, $items = false) {
if($r)
$ret['likes'] = $r;
+
+ $r = q("select * from conv where uid = %d",
+ intval($channel_id)
+ );
+ if($r)
+ $ret['conv'] = $r;
+
+
+ $r = q("select mail.*, conv.guid as conv_guid from mail left join conv on mail.convid = conv.id where mail.uid = %d",
+ intval($channel_id)
+ );
+ if($r) {
+ $m = array();
+ foreach($r as $rr) {
+
+
+
+
+ }
+ $ret['mail'] = $m;
+ }
+
+
+
+
$r = q("select item_id.*, item.mid from item_id left join item on item_id.iid = item.id where item_id.uid = %d",
intval($channel_id)
);
diff --git a/include/items.php b/include/items.php
index 3b0072956..ae5b0ca94 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';
@@ -1594,6 +1594,18 @@ function encode_mail($item) {
$x['body'] = '';
}
+ if($extended) {
+ $x['conv_guid'] = $item['conv_guid'];
+ if(intval($item['mail_deleted']))
+ $x['flags'][] = 'deleted';
+ if(intval($item['mail_replied']))
+ $x['flags'][] = 'replied';
+ if(intval($item['mail_isreply']))
+ $x['flags'][] = 'isreply';
+ if(intval($item['mail_seen']))
+ $x['flags'][] = 'seen';
+ }
+
return $x;
}
@@ -1618,6 +1630,18 @@ function get_mail_elements($x) {
if(in_array('recalled',$x['flags'])) {
$arr['mail_recalled'] = 1;
}
+ if(in_array('replied',$x['flags'])) {
+ $arr['mail_replied'] = 1;
+ }
+ if(in_array('isreply',$x['flags'])) {
+ $arr['mail_isreply'] = 1;
+ }
+ if(in_array('seen',$x['flags'])) {
+ $arr['mail_seen'] = 1;
+ }
+ if(in_array('deleted',$x['flags'])) {
+ $arr['mail_deleted'] = 1;
+ }
}
$key = get_config('system','pubkey');