aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-23 07:43:17 +0200
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-09-23 07:43:17 +0200
commit8cbccb20ef7f1fa82c4a16c6c786d5d748901c02 (patch)
tree83dc6ea9738c06caa0450f5165457aff1648efbb /include/zot.php
parentd7c9f2ccba1f0a19c3b60281589ab7dd611c744b (diff)
parentf506f73d3fc80fb68f63f654b5e93a6920780d6f (diff)
downloadvolse-hubzilla-8cbccb20ef7f1fa82c4a16c6c786d5d748901c02.tar.gz
volse-hubzilla-8cbccb20ef7f1fa82c4a16c6c786d5d748901c02.tar.bz2
volse-hubzilla-8cbccb20ef7f1fa82c4a16c6c786d5d748901c02.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/zot.php b/include/zot.php
index 4b4be477f..288493b07 100644
--- a/include/zot.php
+++ b/include/zot.php
@@ -2816,7 +2816,7 @@ function build_sync_packet($uid = 0, $packet = null, $groups_changed = false) {
$channel = $r[0];
- $h = q("select * from hubloc where hubloc_hash = '%s'",
+ $h = q("select * from hubloc where hubloc_hash = '%s' and hubloc_deleted = 0",
dbesc($channel['channel_hash'])
);
@@ -3312,7 +3312,27 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) {
}
}
- $result[] = array($d['hash'],'channel sync updated',$channel['channel_name'],'');
+
+ if(array_key_exists('item',$arr) && $arr['item'])
+ sync_items($channel,$arr['item']);
+
+ if(array_key_exists('item_id',$arr) && $arr['item_id'])
+ sync_items($channel,$arr['item_id']);
+
+
+ // we should probably do this for all items, but usually we only send one.
+
+ require_once('include/DReport.php');
+
+ if(array_key_exists('item',$arr) && is_array($arr['item'][0])) {
+ $DR = new DReport(z_root(),$d['hash'],$d['hash'],$arr['item'][0]['message_id'],'channel sync processed');
+ $DR->addto_recipient($channel['channel_name'] . ' <' . $channel['channel_address'] . '@' . get_app()->get_hostname() . '>');
+ }
+ else
+ $DR = new DReport(z_root(),$d['hash'],$d['hash'],'sync packet','channel sync delivered');
+
+ $result[] = $DR->get();
+
}
return $result;
@@ -3754,4 +3774,5 @@ function zotinfo($arr) {
}
call_hooks('zot_finger',$ret);
return($ret);
+
}