From 25a81ea500746e2451a6c5aaa5a35fe208b61d62 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 8 Sep 2021 07:50:57 +0000 Subject: update release date --- CHANGELOG | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index e49ffb8d5..d606dc0d7 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,4 +1,4 @@ -Hubzilla 6.2 (2021-09-??) +Hubzilla 6.2 (2021-09-08) - Deprecate the custom highlight [hl] bbcode in favor of [mark] which is a html5 standard - Check post_mail permission when receiving a direct message - Refactor actor store and cache mechanism -- cgit v1.2.3 From 7b0f8f289637d06f610230a0fbe7cfe51cd53d6c Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 8 Sep 2021 19:48:42 +0000 Subject: fix language selector reloading the page if not clicking the icon exactly and bs5 modal issues --- view/js/main.js | 8 ++++---- view/tpl/jot-header.tpl | 4 ++-- view/tpl/wiki.tpl | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index f54dbf593..476e78056 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -87,8 +87,8 @@ $(document).ready(function() { if ( typeof(window.tao.zin) == 'undefined' ) { tao.zin = { syslc: '', syslcs: {}, htm: '', me: '', debug: '' }; tao.zin.axim = '
'; - $('.navbar-app[href*="/lang"]').attr({"data-toggle": "dropdown", "aria-expand": "true", "id": "zintog"}) - .removeAttr('href').addClass('zinlcx zinlcxp dropdown dropdown-toggle'); + $('.navbar-app[href*="/lang"]').attr({"aria-expand": "true", "id": "zintog"}) + .removeAttr('href').addClass('zinlcx zinlcxp dropdown dropdown-toggle').css('cursor','pointer'); $('.dropdown-item[href*="/lang"]').addClass('zinlcxmi zinlcx').removeAttr('href').css('cursor','pointer'); } $('.zinlcx').on('click', function(e) { @@ -108,11 +108,11 @@ $(document).ready(function() { tao.zin.htm += ''; $('.zinpax').remove(); $('.zinlcx').append(tao.zin.htm); - $('.zinlcxp > ul').addClass('dropdown dropdown-menu dropdown-menu-end').css('left','-16em'); + $('.zinlcxp > ul').addClass('dropdown dropdown-menu dropdown-menu-end mt-2 show').css('right', 0); }); return false; } else { - if (e.target.id == '') { + if (e.target.id == '' || e.target.id == 'zintog') { // noop click on lang again return false; } diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index 2ee78cd28..ca3cabd61 100644 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -185,7 +185,7 @@ var activeCommentText = ''; function jotGetExpiry() { //reply = prompt("{{$expirewhen}}", $('#jot-expire').val()); - $('#expiryModal').modal(); + $('#expiryModal').modal('show'); $('#expiry-modal-OKButton').on('click', function() { reply=$('#expiration-date').val(); if(reply && reply.length) { @@ -197,7 +197,7 @@ var activeCommentText = ''; function jotGetPubDate() { //reply = prompt("{{$expirewhen}}", $('#jot-expire').val()); - $('#createdModal').modal(); + $('#createdModal').modal('show'); $('#created-modal-OKButton').on('click', function() { reply=$('#created-date').val(); if(reply && reply.length) { diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 33d4dd097..bf3f64508 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -323,7 +323,7 @@ wiki_revert_page(compareCommit); $('#generic-modal-{{$wikiModalID}}').modal('hide'); }); - $('#generic-modal-{{$wikiModalID}}').modal(); + $('#generic-modal-{{$wikiModalID}}').modal('show'); } else { window.console.log('Error comparing page.'); } @@ -364,7 +364,7 @@ }); getPhotoAlbumList(); $('#embedPhotoModalBodyAlbumDialog').off('click'); - $('#embedPhotoModal').modal(); + $('#embedPhotoModal').modal('show'); }; var choosePhotoFromAlbum = function (album) { -- cgit v1.2.3 From e2d0269b5c9f1f1b865e1c0473a6bc0a0a0a1740 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 10 Sep 2021 08:11:19 +0000 Subject: fix spacing issue for collapsed pinned apps with an image --- view/tpl/app_nav_pinned.tpl | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/view/tpl/app_nav_pinned.tpl b/view/tpl/app_nav_pinned.tpl index 817c74763..b114ed19e 100644 --- a/view/tpl/app_nav_pinned.tpl +++ b/view/tpl/app_nav_pinned.tpl @@ -1 +1,9 @@ -{{if $icon}}{{else}}{{/if}}{{$app.name}} + + {{if $icon}} + + {{$app.name}} + {{else}} + +
{{$app.name}}
+ {{/if}} +
-- cgit v1.2.3 From e5dc3c05dfb79df79f4fd14496bc5e646217c27e Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 10 Sep 2021 12:29:05 +0000 Subject: when updating the channel name from profiles make sure to lookup the xchan entry by xchan_hash since xchan_url is set to the primary location but we might be updating from a clone --- Zotlabs/Lib/Libzot.php | 1 - Zotlabs/Module/Profiles.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 9c232f34d..3f1f16b09 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2745,7 +2745,6 @@ class Libzot { } $e = $r[0]; - $id = $e['channel_id']; $sys_channel = (intval($e['channel_system']) ? true : false); diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php index 452af4d78..631a41ddc 100644 --- a/Zotlabs/Module/Profiles.php +++ b/Zotlabs/Module/Profiles.php @@ -606,10 +606,10 @@ class Profiles extends \Zotlabs\Web\Controller { $channel = \App::get_channel(); if($namechanged && $is_default) { - $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_url = '%s'", + $r = q("UPDATE xchan SET xchan_name = '%s', xchan_name_date = '%s' WHERE xchan_hash = '%s'", dbesc($name), dbesc(datetime_convert()), - dbesc(z_root() . '/channel/' . $channel['channel_address']) + dbesc($channel['xchan_hash']) ); $r = q("UPDATE channel SET channel_name = '%s' WHERE channel_hash = '%s'", dbesc($name), -- cgit v1.2.3 From d115e09abca362eef494a72b1dad46ab4df7a88d Mon Sep 17 00:00:00 2001 From: Mario Date: Sun, 12 Sep 2021 17:54:20 +0000 Subject: do not process summary in cleanup_bbcode() fixes issue #1612 --- include/text.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/text.php b/include/text.php index bd2df45aa..2d863c5ae 100644 --- a/include/text.php +++ b/include/text.php @@ -3547,6 +3547,7 @@ function cleanup_bbcode($body) { */ $body = preg_replace_callback('/\[code(.*?)\[\/(code)\]/ism','\red_escape_codeblock',$body); + $body = preg_replace_callback('/\[summary(.*?)\[\/(summary)\]/ism','\red_escape_codeblock',$body); $body = preg_replace_callback('/\[url(.*?)\[\/(url)\]/ism','\red_escape_codeblock',$body); $body = preg_replace_callback('/\[zrl(.*?)\[\/(zrl)\]/ism','\red_escape_codeblock',$body); $body = preg_replace_callback('/\[svg(.*?)\[\/(svg)\]/ism','\red_escape_codeblock',$body); @@ -3560,9 +3561,10 @@ function cleanup_bbcode($body) { +\,\(\)]+)/ismu", '\red_zrl_callback', $body); - $body = preg_replace_callback('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','\red_unescape_codeblock',$body); - $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','\red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64code(.*?)\[\/(code)\]/ism','\red_unescape_codeblock',$body); + $body = preg_replace_callback('/\[\$b64summary(.*?)\[\/(summary)\]/ism','\red_unescape_codeblock',$body); + $body = preg_replace_callback('/\[\$b64url(.*?)\[\/(url)\]/ism','\red_unescape_codeblock',$body); + $body = preg_replace_callback('/\[\$b64zrl(.*?)\[\/(zrl)\]/ism','\red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64svg(.*?)\[\/(svg)\]/ism','\red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64img(.*?)\[\/(img)\]/ism','\red_unescape_codeblock',$body); $body = preg_replace_callback('/\[\$b64zmg(.*?)\[\/(zmg)\]/ism','\red_unescape_codeblock',$body); -- cgit v1.2.3 From 0b716b3cc7953ef1226b9f8fcee9f746ee1aade1 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 13 Sep 2021 11:36:41 +0000 Subject: fix $desturl set to wrong value (null) --- Zotlabs/Lib/Libzot.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 3f1f16b09..343a3f5f9 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -2636,8 +2636,8 @@ class Libzot { ); if ($r) { - logger('found another site that is not dead: ' . $r[0]['hubloc_url'], LOGGER_DEBUG, LOG_INFO); - $desturl = $r[0]['hubloc_url']; + logger('found another site that is not dead: ' . $r[0]['hubloc_id_url'], LOGGER_DEBUG, LOG_INFO); + $desturl = $r[0]['hubloc_id_url']; } else { return $hash; -- cgit v1.2.3 From 46b8db53ab021be06f6dd9c15e6b69c22609aa0f Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Sep 2021 10:59:16 +0000 Subject: provide a get_cached_actor_provider hook and improve the author/owner handling in Libzot::import() --- Zotlabs/Lib/Activity.php | 16 +++++++++++++++- Zotlabs/Lib/Libzot.php | 36 +++++++++++++++++++++++------------- 2 files changed, 38 insertions(+), 14 deletions(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 62a22f70e..a0a9a7c7f 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -3548,7 +3548,21 @@ class Activity { } static function get_cached_actor($id) { - return (XConfig::Get($id,'system','actor_record')); + $actor = XConfig::Get($id,'system', 'actor_record'); + + if ($actor) { + return $actor; + } + + // try other get_cached_actor providers (e.g. diaspora) + $hookdata = [ + 'id' => $id, + 'actor' => false + ]; + + call_hooks('get_cached_actor_provider', $hookdata); + + return $hookdata['actor']; } static function get_actor_hublocs($url, $options = 'all') { diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index 343a3f5f9..f3cf52a33 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1200,31 +1200,41 @@ class Libzot { if (in_array($env['type'], ['activity', 'response'])) { - $r = q("select hubloc_hash, hubloc_network from hubloc where hubloc_id_url = '%s' ", + if(!isset($AS->actor['id'])) { + logger('No actor id!'); + return; + } + + $r = q("select hubloc_hash, hubloc_network, hubloc_url from hubloc where hubloc_id_url = '%s'", dbesc($AS->actor['id']) ); if ($r) { - // selects a zot6 hash if available, otherwise use whatever we have - $r = self::zot_record_preferred($r); + $r = self::zot_record_preferred($r); $arr['author_xchan'] = $r['hubloc_hash']; } - if (!$arr['author_xchan']) { + if (! $arr['author_xchan']) { logger('No author!'); return; } - $s = q("select hubloc_hash from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", - dbesc($env['sender']) - ); + $arr['owner_xchan'] = $env['sender']; - // in individual delivery, change owner if needed - if ($s) { - $arr['owner_xchan'] = $s[0]['hubloc_hash']; + if(filter_var($env['sender'], FILTER_VALIDATE_URL)) + // in individual delivery, change owner if needed + $s = q("select hubloc_hash, hubloc_url from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", + dbesc($env['sender']) + ); + + if ($s) { + $arr['owner_xchan'] = $s[0]['hubloc_hash']; + } } - else { - $arr['owner_xchan'] = $env['sender']; + + if (! $arr['owner_xchan']) { + logger('No owner!'); + return; } if ($private && (!intval($arr['item_private']))) { @@ -1714,7 +1724,7 @@ class Libzot { } } - $ab = q("select * from abook where abook_channel = %d and abook_xchan = '%s'", + $ab = q("select * from abook where abook_channel = %d and abook_xchan = '%s'", intval($channel['channel_id']), dbesc($arr['owner_xchan']) ); -- cgit v1.2.3 From 9052695a138807c185c897828ed1e959b5e99a59 Mon Sep 17 00:00:00 2001 From: Mario Date: Wed, 15 Sep 2021 11:03:19 +0000 Subject: typo --- Zotlabs/Lib/Libzot.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php index f3cf52a33..e03f0173d 100644 --- a/Zotlabs/Lib/Libzot.php +++ b/Zotlabs/Lib/Libzot.php @@ -1221,7 +1221,7 @@ class Libzot { $arr['owner_xchan'] = $env['sender']; - if(filter_var($env['sender'], FILTER_VALIDATE_URL)) + if(filter_var($env['sender'], FILTER_VALIDATE_URL)) { // in individual delivery, change owner if needed $s = q("select hubloc_hash, hubloc_url from hubloc where hubloc_id_url = '%s' and hubloc_network = 'zot6' limit 1", dbesc($env['sender']) -- cgit v1.2.3