From 18136788e4bfd86b6d6492daeccf270222d0b5fc Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 18 Nov 2020 20:33:32 +0000 Subject: be more specific --- include/items.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index 960aa3580..cda53ac82 100755 --- a/include/items.php +++ b/include/items.php @@ -2502,7 +2502,7 @@ function item_update_parent_commented($item) { ); q("UPDATE item set commented = '%s', changed = '%s' WHERE id = %d", - dbesc(($z) ? $z[0]['commented'] : datetime_convert()), + dbesc(($z[0]['commented']) ? $z[0]['commented'] : datetime_convert()), dbesc(datetime_convert()), intval($item['parent']) ); -- cgit v1.2.3 From 87d7a3053ac06e966ca54911fe50005fb0530e2f Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Nov 2020 11:01:25 +0000 Subject: do not reset item_origin to 1 for deleted items to prevent possible looping and do not set item_uplink for sourced rss items - we can not sen anything to them. --- include/items.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index cda53ac82..e10b2be0f 100755 --- a/include/items.php +++ b/include/items.php @@ -3299,7 +3299,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false $private = 1; $item_wall = 1; - $item_origin = 1; + $item_origin = (($item['item_deleted']) ? 0 : 1); // item_origin for deleted items is set to 0 in delete_imported_item() to prevent looping. In this case we probably should not set it back to 1 here. $item_uplink = 0; $item_nocomment = 0; @@ -3315,7 +3315,7 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false ); } else { - $item_uplink = 1; + $item_uplink = (($item['item_rss']) ? 0 : 1); // Do not set item_uplink for rss items - we can not send anything to them. // 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 -- cgit v1.2.3 From 941db04260b32e41a4302b7c7accc2c13c809d4a Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 25 Nov 2020 13:52:27 +0000 Subject: add a uuid version 5 based uuid to imported feeds. if rewrite author for sourced items, also rewrite mid to be fetchable --- include/items.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include/items.php') diff --git a/include/items.php b/include/items.php index e10b2be0f..a027be4b2 100755 --- a/include/items.php +++ b/include/items.php @@ -3179,8 +3179,18 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false if($rewrite_author) { $item['author_xchan'] = $channel['channel_hash']; - $r = q("update item set author_xchan = '%s' where id = %d", + //if it's a toplevel rss item we will also rewrite the mid to something fetchable + if($item['item_rss'] && $item['item_thread_top']) { + $item['mid'] = z_root() . '/item/' . $item['uuid']; + $item['parent_mid'] = $item['mid']; + $item['thr_parent'] = $item['mid']; + } + + $r = q("UPDATE item SET author_xchan = '%s', mid = '%s', parent_mid = '%s', thr_parent = '%s' WHERE id = %d", dbesc($item['author_xchan']), + dbesc($item['mid']), + dbesc($item['parent_mid']), + dbesc($item['thr_parent']), intval($item_id) ); } @@ -3235,7 +3245,6 @@ function start_delivery_chain($channel, $item, $item_id, $parent, $group = false $arr['item_origin'] = 1; $arr['item_wall'] = 1; - $arr['item_thread_top'] = 1; if (strpos($item['body'], "[/share]") !== false) { -- cgit v1.2.3