aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-22 07:34:42 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-22 07:34:42 +0200
commitcbd7f8906674f6373f0dc6a8f79ecfcd4ce4bd8d (patch)
treef224e6b7737373e0a8432861154a6101da359fa2 /include
parent7834274bff5e86a7a0eb646f1319b5b9e4bac96f (diff)
parent146ff6f70308647b27374a1bba386c156498bd2e (diff)
downloadvolse-hubzilla-cbd7f8906674f6373f0dc6a8f79ecfcd4ce4bd8d.tar.gz
volse-hubzilla-cbd7f8906674f6373f0dc6a8f79ecfcd4ce4bd8d.tar.bz2
volse-hubzilla-cbd7f8906674f6373f0dc6a8f79ecfcd4ce4bd8d.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php12
-rw-r--r--include/zot.php15
2 files changed, 27 insertions, 0 deletions
diff --git a/include/items.php b/include/items.php
index 657168601..b209e55c5 100755
--- a/include/items.php
+++ b/include/items.php
@@ -4417,6 +4417,18 @@ function delete_item_lowlevel($item, $stage = DROPITEM_NORMAL, $force = false) {
intval($item['uid'])
);
+ // remove delivery reports
+
+ $c = q("select channel_hash from channel where channel_id = %d limit 1",
+ intval($item['uid'])
+ );
+ if($c) {
+ q("delete from dreport where dreport_xchan = '%s' and dreport_mid = '%s'",
+ dbesc($c[0]['channel_hash']),
+ dbesc($item['mid'])
+ );
+ }
+
// network deletion request. Keep the message structure so that we can deliver delete notifications.
// Come back after several days (or perhaps a month) to do the lowlevel delete (DROPITEM_PHASE2).
diff --git a/include/zot.php b/include/zot.php
index 767abae38..f728d8fb9 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -957,6 +957,21 @@ function zot_process_response($hub, $arr, $outq) {
logger('zot_process_response: headers: ' . print_r($arr['header'],true), LOGGER_DATA);
}
+ if(array_key_exists('delivery_report',$x)) {
+ foreach($x['delivery_report'] as $xx) {
+ if(is_array($xx) && array_key_exists('message_id',$xx)) {
+ q("insert into dreport ( dreport_mid, dreport_site, dreport_recip, dreport_result, dreport_time, dreport_xchan ) values ( '%s', '%s','%s','%s','%s','%s' ) ",
+ dbesc($xx['message_id']),
+ dbesc($xx['location']),
+ dbesc($xx['recipient']),
+ dbesc($xx['status']),
+ dbesc(datetime_convert($xx['date'])),
+ dbesc($xx['sender'])
+ );
+ }
+ }
+ }
+
// update the timestamp for this site
q("update site set site_dead = 0, site_update = '%s' where site_url = '%s'",