diff options
author | Mario <mario@mariovavti.com> | 2020-11-26 18:43:53 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-11-26 18:43:53 +0000 |
commit | 0f6166da004317045bae5430140c70ee0d60aad1 (patch) | |
tree | 78145aa23c2c60acab9add4299ee50935898a46a /include | |
parent | 25620081a1326eb243c974845d613a16b7be1966 (diff) | |
parent | 07e5b8295ea9d342f66d8119d88bd58124b548e6 (diff) | |
download | volse-hubzilla-5.0.3.tar.gz volse-hubzilla-5.0.3.tar.bz2 volse-hubzilla-5.0.3.zip |
Merge branch 'dev'5.0.3
Diffstat (limited to 'include')
-rw-r--r-- | include/channel.php | 20 | ||||
-rw-r--r-- | include/conversation.php | 5 | ||||
-rw-r--r-- | include/feedutils.php | 12 | ||||
-rwxr-xr-x | include/items.php | 19 | ||||
-rw-r--r-- | include/socgraph.php | 2 | ||||
-rw-r--r-- | include/text.php | 2 |
6 files changed, 33 insertions, 27 deletions
diff --git a/include/channel.php b/include/channel.php index e2be4d8a8..71fad5222 100644 --- a/include/channel.php +++ b/include/channel.php @@ -2573,26 +2573,6 @@ function channel_reddress($channel) { return strtolower($channel['channel_address'] . '@' . App::get_hostname()); } - -/** - * @brief Get manual channel conversation update config. - * - * Check the channel config \e manual_conversation_update, if not set fall back - * to global system config, defaults to 1 if nothing set. - * - * @param int $channel_id - * @return int - */ -function channel_manual_conv_update($channel_id) { - - $x = get_pconfig($channel_id, 'system', 'manual_conversation_update'); - if($x === false) - $x = get_config('system', 'manual_conversation_update', 1); - - return intval($x); -} - - /** * @brief Return parsed HTML remote_login template. * diff --git a/include/conversation.php b/include/conversation.php index e77404cff..6615b04c3 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -511,6 +511,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa $jsreload = ''; $preview = (($page_mode === 'preview') ? true : false); + $r_preview = (($page_mode === 'r_preview') ? true : false); $previewing = (($preview) ? ' preview ' : ''); $preview_lbl = t('This is an unsaved preview'); @@ -873,11 +874,13 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa } + $item['pagedrop'] = $page_dropping; - if($item['id'] == $item['parent']) { + if($item['id'] == $item['parent'] || $r_preview) { $item_object = new Zotlabs\Lib\ThreadItem($item); + $conv->add_thread($item_object); if(($page_mode === 'list') || ($page_mode === 'pager_list')) { $item_object->set_template('conv_list.tpl'); diff --git a/include/feedutils.php b/include/feedutils.php index 0a9af7ee1..5f5f563f8 100644 --- a/include/feedutils.php +++ b/include/feedutils.php @@ -13,6 +13,10 @@ * @param array $params associative array which configures the feed * @return string with an atom feed */ + +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\Exception\UnsatisfiedDependencyException; + function get_public_feed($channel, $params) { if(! $params) @@ -431,6 +435,13 @@ function get_atom_elements($feed, $item) { $res['plink'] = unxmlify($item->get_link(0)); $res['item_rss'] = 1; + try { + $uuid = Uuid::uuid5(Uuid::NAMESPACE_URL, $res['plink'])->toString(); + } catch (UnsatisfiedDependencyException $e) { + $uuid = md5($res['plink']); + } + + $res['uuid'] = $uuid; $summary = unxmlify($item->get_description(true)); @@ -1516,6 +1527,7 @@ function consume_feed($xml, $importer, &$contact, $pass = 0) { continue; } + } } } diff --git a/include/items.php b/include/items.php index 960aa3580..a027be4b2 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']) ); @@ -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) { @@ -3299,7 +3308,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 +3324,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 diff --git a/include/socgraph.php b/include/socgraph.php index 3da4dce63..aaea4550c 100644 --- a/include/socgraph.php +++ b/include/socgraph.php @@ -271,6 +271,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) { and xchan_hidden = 0 and xchan_deleted = 0 and xlink_static = 0 + and xchan_network = 'zot6' group by xchan_hash order by total desc limit %d offset %d ", intval($uid), intval($uid), @@ -290,6 +291,7 @@ function suggestion_query($uid, $myxchan, $start = 0, $limit = 80) { and xchan_hidden = 0 and xchan_deleted = 0 and xlink_static = 0 + and xchan_network = 'zot6' group by xchan_hash order by total desc limit %d offset %d ", intval($uid), intval($uid), diff --git a/include/text.php b/include/text.php index 58cde7838..c2a45814c 100644 --- a/include/text.php +++ b/include/text.php @@ -1667,7 +1667,7 @@ function format_filer(&$item) { if(! trim($term)) continue; $removelink = z_root() . '/filerm/' . $item['id'] . '?f=&term=' . urlencode($t['term']); - $categories[] = array('term' => $term, 'removelink' => $removelink); + $categories[] = array('term' => $term, 'removelink' => $removelink, 'id' => $item['id']); } $s = replace_macros(get_markup_template('item_filer.tpl'),array( |