diff --git a/Code/Lib/Activity.php b/Code/Lib/Activity.php index 614600019..f095aa43e 100644 --- a/Code/Lib/Activity.php +++ b/Code/Lib/Activity.php @@ -2015,6 +2015,10 @@ class Activity set_abconfig($channel['channel_id'], $person_obj['id'], 'activitypub', 'their_follow_id', $their_follow_id); set_abconfig($channel['channel_id'], $person_obj['id'], 'activitypub', 'their_follow_type', $act->type); + // In case they unfollowed us and followed again, reset their permissions to show that we're connected again. + if ($their_perms) { + AbConfig::Set($channel['channel_id'], $person_obj['id'], 'system', 'their_perms', $their_perms); + } Run::Summon(['Notifier', 'permissions_accept', $contact['abook_id']]); return; diff --git a/Code/Lib/Enotify.php b/Code/Lib/Enotify.php index ca703fdd9..4fd79f0a6 100644 --- a/Code/Lib/Enotify.php +++ b/Code/Lib/Enotify.php @@ -231,10 +231,13 @@ class Enotify //$possess_desc = str_replace('',$possess_desc); + // Put zero-width spaces between the links and the sender name in case they contain parens, + // as these will be interpreted as markdown links when rendered. + // "a post" $dest_str = sprintf( t('%1$s %2$s [zrl=%3$s]a %4$s[/zrl]'), - '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', + '[zrl=' . $sender['xchan_url'] . ']' . html_entity_decode('​') . $sender['xchan_name'] . '[/zrl]', $action, $itemlink, $item_post_type @@ -244,7 +247,7 @@ class Enotify if ($p) { $dest_str = sprintf( t('%1$s %2$s [zrl=%3$s]%4$s\'s %5$s[/zrl]'), - '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', + '[zrl=' . $sender['xchan_url'] . ']' . html_entity_decode('​') . $sender['xchan_name'] . '[/zrl]', $action, $itemlink, $p[0]['author']['xchan_name'], @@ -256,7 +259,7 @@ class Enotify if ($p[0]['owner']['xchan_name'] == $p[0]['author']['xchan_name'] && intval($p[0]['item_wall'])) { $dest_str = sprintf( t('%1$s %2$s [zrl=%3$s]your %4$s[/zrl]'), - '[zrl=' . $sender['xchan_url'] . ']' . $sender['xchan_name'] . '[/zrl]', + '[zrl=' . $sender['xchan_url'] . ']' . html_entity_decode('​') . $sender['xchan_name'] . '[/zrl]', $action, $itemlink, $item_post_type diff --git a/Code/Lib/ThreadItem.php b/Code/Lib/ThreadItem.php index 3c959eebc..6b6440134 100644 --- a/Code/Lib/ThreadItem.php +++ b/Code/Lib/ThreadItem.php @@ -304,6 +304,20 @@ class ThreadItem $has_event = true; } + $colours = [ + '_aqua', + '_fuschia', + '_orange', + '_teal', + '_maroon', + '_lime', + '_red', + '_blue', + '_gray', + '_yellow', + '_olive', + ]; + if ($this->is_commentable() && $observer) { $like = [t('I like this'), t('Undo like')]; $dislike = [t('I don\'t like this'), t('Undo dislike')]; @@ -388,6 +402,8 @@ class ThreadItem 'categories' => $body['categories'], 'mentions' => $body['mentions'], 'attachments' => $body['attachments'], + 'colours' => $colours, + 'colourIndex' => 0, 'folders' => $body['folders'], 'text' => strip_tags($body['html']), 'id' => $this->get_id(), diff --git a/Code/Module/Admin/Site.php b/Code/Module/Admin/Site.php index cebeb7f7e..4da0c8053 100644 --- a/Code/Module/Admin/Site.php +++ b/Code/Module/Admin/Site.php @@ -294,7 +294,7 @@ class Site '$register_text' => ['register_text', t("Register text"), htmlspecialchars(get_config('system', 'register_text'), ENT_QUOTES, 'UTF-8'), t("Will be displayed prominently on the registration page.")], '$tos_required' => [ 'tos_required', t('Require acceptance of Terms of Service'),get_config('system','tos_required'),'', [ t('No'), t('Yes') ] ], '$role' => $role, - '$frontpage' => ['frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system', 'frontpage'), t("example: 'public' to show public stream, 'page/sys/home' to show a system webpage called 'home' or 'include:home.html' to include a file.")], + '$frontpage' => ['frontpage', t("Site homepage to show visitors (default: login box)"), get_config('system', 'frontpage'), t("example: 'pubstream' to show public stream, 'channel/bob' to show Bob's channel or 'include:home.html' to include a file.")], '$mirror_frontpage' => ['mirror_frontpage', t("Preserve site homepage URL"), get_config('system', 'mirror_frontpage'), t('Present the site homepage in a frame at the original location instead of redirecting')], '$abandon_days' => ['abandon_days', t('Accounts abandoned after x days'), get_config('system', 'account_abandon_days'), t('Will not waste system resources polling external sites for abandonded accounts. Enter 0 for no time limit.')], '$verify_email' => ['verify_email', t("Verify Email Addresses"), get_config('system', 'verify_email'), t("Check to verify email addresses used in account registration (recommended).")], diff --git a/Code/Web/WebServer.php b/Code/Web/WebServer.php index 7ed8bd48a..b0848a1ce 100644 --- a/Code/Web/WebServer.php +++ b/Code/Web/WebServer.php @@ -187,6 +187,10 @@ class WebServer 'type' => 'application/jrd+json', 'href' => z_root() . '/.well-known/webfinger?f=&resource=acct%3A' . argv(1) . '%40' . App::get_hostname() ], + [ + 'rel' => 'me', + 'href' => z_root() . '/channel/' . argv(1) + ], [ 'rel' => 'alternate', diff --git a/composer.json b/composer.json index 072081a0f..669091616 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,8 @@ "symfony/mailer": "^5.4", "wapmorgan/mp3info": "^0.0.8", "chillerlan/php-qrcode": "^4.3", - "spomky-labs/otphp": "^10.0" + "spomky-labs/otphp": "^10.0", + "indieweb/rel-me": "^0.1.1" }, "require-dev" : { "phpunit/phpunit" : "@stable", diff --git a/composer.lock b/composer.lock index bd636d7ab..ce48f7820 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ccfde141103019de1877d46c5eea9d23", + "content-hash": "0d1e59ae6f8944ba4fb85129c1f575d6", "packages": [ { "name": "beberlei/assert", @@ -752,6 +752,45 @@ }, "time": "2021-08-26T18:46:39+00:00" }, + { + "name": "indieweb/rel-me", + "version": "v0.1.1", + "source": { + "type": "git", + "url": "https://github.com/indieweb/rel-me.git", + "reference": "705b15f6e91f314fd26d5962dcf00fc117e42965" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/indieweb/rel-me/zipball/705b15f6e91f314fd26d5962dcf00fc117e42965", + "reference": "705b15f6e91f314fd26d5962dcf00fc117e42965", + "shasum": "" + }, + "require": { + "mf2/mf2": "^0.5", + "php": ">=5.6" + }, + "require-dev": { + "barnabywalters/mf-cleaner": "dev-master", + "yoast/phpunit-polyfills": "^1.0" + }, + "type": "library", + "autoload": { + "files": [ + "RelMe.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Functions for discovering, consuming and verifying rel-me microformat", + "support": { + "issues": "https://github.com/indieweb/rel-me/issues", + "source": "https://github.com/indieweb/rel-me/tree/v0.1.1" + }, + "time": "2022-10-08T21:02:51+00:00" + }, { "name": "jbroadway/urlify", "version": "1.2.4-stable", @@ -1028,6 +1067,68 @@ }, "time": "2022-08-18T16:18:26+00:00" }, + { + "name": "mf2/mf2", + "version": "v0.5.0", + "source": { + "type": "git", + "url": "https://github.com/microformats/php-mf2.git", + "reference": "ddc56de6be62ed4a21f569de9b80e17af678ca50" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/microformats/php-mf2/zipball/ddc56de6be62ed4a21f569de9b80e17af678ca50", + "reference": "ddc56de6be62ed4a21f569de9b80e17af678ca50", + "shasum": "" + }, + "require": { + "php": ">=5.6.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "mf2/tests": "dev-master#e9e2b905821ba0a5b59dab1a8eaf40634ce9cd49", + "phpcompatibility/php-compatibility": "^9.3", + "phpunit/phpunit": "^5.7", + "squizlabs/php_codesniffer": "^3.6.2" + }, + "suggest": { + "barnabywalters/mf-cleaner": "To more easily handle the canonical data php-mf2 gives you", + "masterminds/html5": "Alternative HTML parser for PHP, for better HTML5 support." + }, + "bin": [ + "bin/fetch-mf2", + "bin/parse-mf2" + ], + "type": "library", + "autoload": { + "files": [ + "Mf2/Parser.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "CC0-1.0" + ], + "authors": [ + { + "name": "Barnaby Walters", + "homepage": "http://waterpigs.co.uk" + } + ], + "description": "A pure, generic microformats2 parser — makes HTML as easy to consume as a JSON API", + "keywords": [ + "html", + "microformats", + "microformats 2", + "parser", + "semantic" + ], + "support": { + "issues": "https://github.com/microformats/php-mf2/issues", + "source": "https://github.com/microformats/php-mf2/tree/v0.5.0" + }, + "time": "2022-02-10T01:05:27+00:00" + }, { "name": "michelf/php-markdown", "version": "1.9.1", @@ -7583,5 +7684,5 @@ "platform-overrides": { "php": "8.0" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 78264aeab..ea71f0c62 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -186,7 +186,7 @@ a:focus, ._blue { color: blue !important; } -._ fuschia{ +._fuschia { color: fuchsia !important; } ._gray { diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index c4c977586..649d224a5 100755 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -12,7 +12,7 @@
{{if $item.thread_level > 1}}
{{/if}} - {{for $x=3 to $item.thread_level}}{{/for}} + {{for $x=3 to $item.thread_level}}{{$item.colourIndex=$item.colourIndex+1}}{{if $item.colourIndex>9}}{{$item.colourIndex=0}}{{/if}}{{/for}} {{if $item.indentpx}}
2}}style="margin-left: {{$item.thread_level * $item.indentpx}}px;"{{/if}}> {{/if}} diff --git a/view/tpl/jot-header.tpl b/view/tpl/jot-header.tpl index a4f751b1a..a1de71c27 100755 --- a/view/tpl/jot-header.tpl +++ b/view/tpl/jot-header.tpl @@ -740,9 +740,9 @@ let postSaveTimer = null; $('#embedPhotoModalBodyAlbumList').html(''); for(let i=0; i' + albumName + ''; + let jsAlbumName = albums[i].jstext; + let albumLink = ''; $('#embedPhotoModalBodyAlbumList').find('ul').append(albumLink); }