Merge pull request 'dev' (#3) from streams/streams:dev into dev

Reviewed-on: https://codeberg.org/elvecio/streams/pulls/3
This commit is contained in:
elvecio 2023-03-28 18:34:56 +00:00
commit d66de649c2
10 changed files with 141 additions and 12 deletions

View file

@ -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;

View file

@ -231,10 +231,13 @@ class Enotify
//$possess_desc = str_replace('<!item_type!>',$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('&#8203;') . $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('&#8203;') . $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('&#8203;') . $sender['xchan_name'] . '[/zrl]',
$action,
$itemlink,
$item_post_type

View file

@ -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(),

View file

@ -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).")],

View file

@ -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',

View file

@ -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",

105
composer.lock generated
View file

@ -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"
}

View file

@ -186,7 +186,7 @@ a:focus,
._blue {
color: blue !important;
}
._ fuschia{
._fuschia {
color: fuchsia !important;
}
._gray {

View file

@ -12,7 +12,7 @@
<div class="wall-item-outside-wrapper{{if $item.is_comment}} comment{{/if}}{{if $item.previewing}} preview{{/if}}" id="wall-item-outside-wrapper-{{$item.id}}" >
<div class="clearfix wall-item-content-wrapper{{if $item.is_comment}} comment{{/if}}" id="wall-item-content-wrapper-{{$item.id}}">
{{if $item.thread_level > 1}}<hr class="thread-separator">{{/if}}
{{for $x=3 to $item.thread_level}}<i class="fa fa-caret-right threadlevel {{if $x is odd}}odd{{else}}even{{/if}}"></i>{{/for}}
{{for $x=3 to $item.thread_level}}<i class="fa fa-caret-right threadlevel {{$item.colours[$item.colourIndex]}}"></i>{{$item.colourIndex=$item.colourIndex+1}}{{if $item.colourIndex>9}}{{$item.colourIndex=0}}{{/if}}{{/for}}
{{if $item.indentpx}}
<div {{if $item.thread_level > 2}}style="margin-left: {{$item.thread_level * $item.indentpx}}px;"{{/if}}>
{{/if}}