aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rwxr-xr-xinclude/items.php21
1 files changed, 15 insertions, 6 deletions
diff --git a/include/items.php b/include/items.php
index 58461cc3a..cae380b01 100755
--- a/include/items.php
+++ b/include/items.php
@@ -2150,6 +2150,7 @@ function item_store_update($arr, $allow_exec = false, $deliver = true) {
unset($arr['created']);
unset($arr['author_xchan']);
unset($arr['owner_xchan']);
+ unset($arr['source_xchan']);
unset($arr['thr_parent']);
unset($arr['llink']);
@@ -2514,7 +2515,7 @@ function tag_deliver($uid, $item_id) {
// Just start the second delivery chain to deliver the updated post
// after resetting ownership and permission bits
logger('updating edited tag_deliver post for ' . $u[0]['channel_address']);
- start_delivery_chain($u[0], $item, $item_id, 0);
+ start_delivery_chain($u[0], $item, $item_id, 0, true);
return;
}
@@ -2941,7 +2942,7 @@ function tgroup_check($uid, $item) {
* @param int $item_id
* @param boolean $parent
*/
-function start_delivery_chain($channel, $item, $item_id, $parent) {
+function start_delivery_chain($channel, $item, $item_id, $parent, $edit = false) {
$sourced = check_item_source($channel['channel_id'],$item);
@@ -2950,7 +2951,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent) {
intval($channel['channel_id']),
dbesc(($item['source_xchan']) ? $item['source_xchan'] : $item['owner_xchan'])
);
- if($r) {
+ if($r && ! $edit) {
$t = trim($r[0]['src_tag']);
if($t) {
$tags = explode(',',$t);
@@ -3017,9 +3018,17 @@ function start_delivery_chain($channel, $item, $item_id, $parent) {
}
else {
$item_uplink = 1;
- $r = q("update item set source_xchan = owner_xchan where id = %d",
- intval($item_id)
- );
+
+ // if this is an edit, item_store_update() will have already updated the item
+ // with the correct value for source_xchan (by ignoring it). We cannot set to owner_xchan
+ // in this case because owner_xchan will point to the parent of this chain
+ // and not the original sender.
+
+ if(! $edit) {
+ $r = q("update item set source_xchan = owner_xchan where id = %d",
+ intval($item_id)
+ );
+ }
}
$title = $item['title'];