diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-07 18:11:30 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-07 18:11:30 -0700 |
commit | 9fa0490c4494b4c01f6b2bb84cb0915562127fe4 (patch) | |
tree | c54df3259c472de01a7644c69bc3346cbc7ced8f /mod | |
parent | 5d59462e49b893507c714d9ec72472e884677cd5 (diff) | |
download | volse-hubzilla-9fa0490c4494b4c01f6b2bb84cb0915562127fe4.tar.gz volse-hubzilla-9fa0490c4494b4c01f6b2bb84cb0915562127fe4.tar.bz2 volse-hubzilla-9fa0490c4494b4c01f6b2bb84cb0915562127fe4.zip |
sync posted top level items rather than deliver them (actually we do both, but sync comes first). This way we get the ACL transferred.
Diffstat (limited to 'mod')
-rw-r--r-- | mod/item.php | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/mod/item.php b/mod/item.php index bc2710b42..bff312cfe 100644 --- a/mod/item.php +++ b/mod/item.php @@ -823,6 +823,19 @@ function item_post(&$a) { update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid); + if(! $parent) { + $r = q("select * from item where id = %d", + intval($post_id) + ); + if($r) { + xchan_query($r); + $sync_item = fetch_post_tags($r); + $rid = q("select * from item_id where iid = %d", + intval($post_id) + ); + build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true)),'item_id' => $rid)); + } + } if(! $nopush) proc_run('php', "include/notifier.php", 'edit_post', $post_id); @@ -903,14 +916,28 @@ function item_post(&$a) { // NOTREACHED } - if($parent) { + + update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid); + + if(($parent) && ($parent != $post_id)) { // Store the comment signature information in case we need to relay to Diaspora $ditem = $datarray; $ditem['author'] = $observer; store_diaspora_comment_sig($ditem,$channel,$parent_item, $post_id, (($walltowall_comment) ? 1 : 0)); } - - update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid); + else { + $r = q("select * from item where id = %d", + intval($post_id) + ); + if($r) { + xchan_query($r); + $sync_item = fetch_post_tags($r); + $rid = q("select * from item_id where iid = %d", + intval($post_id) + ); + build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true)),'item_id' => $rid)); + } + } $datarray['id'] = $post_id; $datarray['llink'] = $a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id; |