sync posted top level items rather than deliver them (actually we do both, but sync comes first). This way we get the ACL transferred.
This commit is contained in:
parent
5d59462e49
commit
9fa0490c44
33
mod/item.php
33
mod/item.php
@ -823,6 +823,19 @@ function item_post(&$a) {
|
|||||||
|
|
||||||
update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid);
|
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)
|
if(! $nopush)
|
||||||
proc_run('php', "include/notifier.php", 'edit_post', $post_id);
|
proc_run('php', "include/notifier.php", 'edit_post', $post_id);
|
||||||
|
|
||||||
@ -903,14 +916,28 @@ function item_post(&$a) {
|
|||||||
// NOTREACHED
|
// 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
|
// Store the comment signature information in case we need to relay to Diaspora
|
||||||
$ditem = $datarray;
|
$ditem = $datarray;
|
||||||
$ditem['author'] = $observer;
|
$ditem['author'] = $observer;
|
||||||
store_diaspora_comment_sig($ditem,$channel,$parent_item, $post_id, (($walltowall_comment) ? 1 : 0));
|
store_diaspora_comment_sig($ditem,$channel,$parent_item, $post_id, (($walltowall_comment) ? 1 : 0));
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
update_remote_id($channel,$post_id,$webpage,$pagetitle,$namespace,$remote_id,$mid);
|
$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['id'] = $post_id;
|
||||||
$datarray['llink'] = $a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id;
|
$datarray['llink'] = $a->get_baseurl() . '/display/' . $channel['channel_address'] . '/' . $post_id;
|
||||||
|
Reference in New Issue
Block a user