diff options
Diffstat (limited to 'include/items.php')
-rw-r--r-- | include/items.php | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/include/items.php b/include/items.php index 23222892f..423d626ad 100644 --- a/include/items.php +++ b/include/items.php @@ -3196,7 +3196,9 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false } else { - $arr['uuid'] = item_message_id(); + // To prevent duplicates from possible clones of the forum/group, + // will create a v5 UUID of the source item mid. + $arr['uuid'] = uuid_from_url($item['mid']); $arr['mid'] = z_root() . '/item/' . $arr['uuid']; $arr['parent_mid'] = $arr['mid']; } @@ -5110,25 +5112,19 @@ function copy_of_pubitem($channel,$mid) { return $item[0]; } - - $r = q("select * from item where parent_mid = (select parent_mid from item where mid = '%s' and uid = %d ) order by id ", + $r = q("select * from item where parent_mid = (select parent_mid from item where mid = '%s' and uid = %d) and uid = %d order by id ", dbesc($mid), + intval($syschan['channel_id']), intval($syschan['channel_id']) ); if($r) { $items = fetch_post_tags($r,true); foreach($items as $rv) { - $d = q("select id from item where mid = '%s' and uid = %d limit 1", - dbesc($rv['mid']), - intval($channel['channel_id']) - ); - if($d) { - continue; - } unset($rv['id']); unset($rv['parent']); + $rv['aid'] = $channel['channel_account_id']; $rv['uid'] = $channel['channel_id']; $rv['item_wall'] = 0; @@ -5141,5 +5137,6 @@ function copy_of_pubitem($channel,$mid) { } } + return $result; } |