diff options
author | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-09-23 07:43:17 +0200 |
---|---|---|
committer | Haakon Meland Eriksen <haakon.eriksen@far.no> | 2015-09-23 07:43:17 +0200 |
commit | 8cbccb20ef7f1fa82c4a16c6c786d5d748901c02 (patch) | |
tree | 83dc6ea9738c06caa0450f5165457aff1648efbb | |
parent | d7c9f2ccba1f0a19c3b60281589ab7dd611c744b (diff) | |
parent | f506f73d3fc80fb68f63f654b5e93a6920780d6f (diff) | |
download | volse-hubzilla-8cbccb20ef7f1fa82c4a16c6c786d5d748901c02.tar.gz volse-hubzilla-8cbccb20ef7f1fa82c4a16c6c786d5d748901c02.tar.bz2 volse-hubzilla-8cbccb20ef7f1fa82c4a16c6c786d5d748901c02.zip |
Merge remote-tracking branch 'upstream/master'
-rwxr-xr-x | include/items.php | 1 | ||||
-rw-r--r-- | include/zot.php | 25 |
2 files changed, 24 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php index b209e55c5..7793d1fb2 100755 --- a/include/items.php +++ b/include/items.php @@ -836,6 +836,7 @@ function title_is_body($title, $body) { function get_item_elements($x,$allow_code = false) { $arr = array(); + if($allow_code) $arr['body'] = $x['body']; else 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); + } |