kopia lustrzana https://github.com/friendica/friendica
Porównaj commity
34 Commity
2c689f2b73
...
2f526f7a80
Autor | SHA1 | Data |
---|---|---|
Hypolite Petovan | 2f526f7a80 | |
Tobias Diekershoff | 2785b074f8 | |
Hypolite Petovan | 8a693fed37 | |
Hypolite Petovan | 6f5585ffd7 | |
foss- | c9f6590353 | |
foss- | 3f1cac2251 | |
Hypolite Petovan | 3a8f1f6304 | |
foss- | a5c265b6aa | |
foss- | ea79782a93 | |
Hypolite Petovan | 882673c260 | |
Michael | 668bb3e6f4 | |
Hypolite Petovan | 7331e44a1c | |
Michael | 1ffdb19c8e | |
Hypolite Petovan | 5c62d91960 | |
Hypolite Petovan | 7615a3103f | |
Michael | 2ecdd683ac | |
Michael | a9b78d1974 | |
Michael Vogel | e6c23e69cc | |
Hypolite Petovan | c81a47c764 | |
Hypolite Petovan | 4bbc1d84ce | |
Hypolite Petovan | f7cb9ec504 | |
Michael | 28363a5416 | |
Michael | f1be6d5181 | |
Michael | b75fdbbd32 | |
Philipp | 9ce2142d99 | |
Philipp | 4f24247aa7 | |
Philipp | 0eec20d203 | |
Philipp | adeb9af502 | |
Philipp | c577773e07 | |
Tobias Diekershoff | b8396daca2 | |
Michael | eaddf5318a | |
Tobias Diekershoff | 49b79d0457 | |
Michael | 8ce1797480 | |
foss- | 650aa089d9 |
|
@ -39,7 +39,7 @@ steps:
|
|||
branch: [ develop, '*-rc' ]
|
||||
event: push
|
||||
composer_install:
|
||||
image: friendicaci/php7.4:php7.4.33
|
||||
image: friendicaci/php8.2:php8.2.16
|
||||
commands:
|
||||
- export COMPOSER_HOME=.composer
|
||||
- composer validate
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
matrix:
|
||||
include:
|
||||
- PHP_MAJOR_VERSION: 7.4
|
||||
PHP_VERSION: 7.4.33
|
||||
- PHP_MAJOR_VERSION: 8.2
|
||||
PHP_VERSION: 8.2.16
|
||||
|
||||
branches:
|
||||
exclude: [ stable ]
|
||||
when:
|
||||
- branch:
|
||||
exclude: [ stable ]
|
||||
|
||||
# This forces CI executions at the "opensocial" labeled location (because of much more power...)
|
||||
labels:
|
||||
|
|
|
@ -8,5 +8,6 @@ steps:
|
|||
commands:
|
||||
- /check-messages.sh
|
||||
|
||||
branches:
|
||||
exclude: [ stable ]
|
||||
when:
|
||||
- branch:
|
||||
exclude: [ stable ]
|
||||
|
|
|
@ -5,9 +5,11 @@ matrix:
|
|||
- PHP_MAJOR_VERSION: 8.0
|
||||
PHP_VERSION: 8.0.30
|
||||
- PHP_MAJOR_VERSION: 8.1
|
||||
PHP_VERSION: 8.1.23
|
||||
PHP_VERSION: 8.1.27
|
||||
- PHP_MAJOR_VERSION: 8.2
|
||||
PHP_VERSION: 8.2.11
|
||||
PHP_VERSION: 8.2.16
|
||||
- PHP_MAJOR_VERSION: 8.3
|
||||
PHP_VERSION: 8.3.3
|
||||
|
||||
# This forces PHP Unit executions at the "opensocial" labeled location (because of much more power...)
|
||||
labels:
|
||||
|
@ -16,7 +18,6 @@ labels:
|
|||
steps:
|
||||
php-lint:
|
||||
image: php:${PHP_MAJOR_VERSION}
|
||||
group: lint
|
||||
commands:
|
||||
- find . -name \*.php -not -path './vendor/*' -not -path './view/asset/*' -print0 | xargs -0 -n1 php -l
|
||||
restore_cache:
|
||||
|
@ -64,7 +65,7 @@ steps:
|
|||
- cp config/local-sample.config.php config/local.config.php
|
||||
- if ! bin/wait-for-connection $MYSQL_HOST $MYSQL_PORT 300; then echo "[ERROR] Waited 300 seconds, no response" >&2; exit 1; fi
|
||||
- mysql -h$MYSQL_HOST -P$MYSQL_PORT -p$MYSQL_PASSWORD -u$MYSQL_USER $MYSQL_DATABASE < database.sql
|
||||
- if [ "${PHP_MAJOR_VERSION}" = "7.4" -a "${CI_REPO}" = "friendica/friendica" ]; then
|
||||
- if [ "${PHP_MAJOR_VERSION}" = "8.2" -a "${CI_REPO}" = "friendica/friendica" ]; then
|
||||
phpenmod xdebug;
|
||||
export XDEBUG_MODE=coverage;
|
||||
phpunit --configuration tests/phpunit.xml -d memory_limit=-1 --coverage-clover clover.xml;
|
||||
|
@ -75,8 +76,8 @@ steps:
|
|||
image: friendicaci/codecov
|
||||
when:
|
||||
matrix:
|
||||
PHP_MAJOR_VERSION: 7.4
|
||||
PHP_VERSION: 7.4.33
|
||||
PHP_MAJOR_VERSION: 8.2
|
||||
PHP_VERSION: 8.2.16
|
||||
repo:
|
||||
- friendica/friendica
|
||||
commands:
|
||||
|
|
|
@ -37,7 +37,7 @@ steps:
|
|||
branch: stable
|
||||
event: tag
|
||||
composer_install:
|
||||
image: friendicaci/php7.4:php7.4.33
|
||||
image: friendicaci/php8.2:php8.2.16
|
||||
commands:
|
||||
- export COMPOSER_HOME=.composer
|
||||
- composer validate
|
||||
|
|
|
@ -32,6 +32,7 @@ Anthronaut
|
|||
Anton
|
||||
Antron Samurai
|
||||
Anubis2814
|
||||
arcanicanis
|
||||
Arian - Cazare Muncitori
|
||||
Asher Pen
|
||||
atjn
|
||||
|
@ -136,6 +137,7 @@ gudzpoz
|
|||
GunChleoc
|
||||
guzzisti
|
||||
Haakon Meland Eriksen
|
||||
haheute
|
||||
Hank Grabowski
|
||||
Hannes Heute
|
||||
Hans Meine
|
||||
|
@ -147,6 +149,7 @@ hlad
|
|||
hoergen
|
||||
Hubert Kościański
|
||||
Hypolite Petovan
|
||||
ike
|
||||
Ilmari
|
||||
ImgBotApp
|
||||
irhen
|
||||
|
@ -222,6 +225,7 @@ Michal Šupler
|
|||
Michalina
|
||||
Mike Macgirvin
|
||||
miqrogroove
|
||||
Morgan McMillian
|
||||
mpanhans
|
||||
mytbk
|
||||
nathilia-peirce
|
||||
|
@ -255,8 +259,10 @@ Pierre Bernardeau
|
|||
Pierre Rudloff
|
||||
Piotr Blonkowski
|
||||
Piotr Strębski
|
||||
pixelroot
|
||||
pokerazor
|
||||
R C
|
||||
r1pu5u
|
||||
Rabuzarus
|
||||
Radek
|
||||
Rafael Garau
|
||||
|
@ -294,9 +300,11 @@ Senex Petrovic
|
|||
Seth
|
||||
SickShark X
|
||||
Silke Meyer
|
||||
Simon
|
||||
Simon L'nu
|
||||
Simon Rupf
|
||||
Simó Albert i Beltran
|
||||
snajafov
|
||||
softmetz
|
||||
soko1
|
||||
Spencer Dub
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
-- ------------------------------------------
|
||||
-- Friendica 2024.03-rc (Yellow Archangel)
|
||||
-- DB_UPDATE_VERSION 1556
|
||||
-- DB_UPDATE_VERSION 1557
|
||||
-- ------------------------------------------
|
||||
|
||||
|
||||
|
|
|
@ -11,21 +11,7 @@ Authentication is the same as described in [Using the APIs](help/api#Authenticat
|
|||
|
||||
## Clients
|
||||
|
||||
### Supported apps
|
||||
|
||||
For supported apps please have a look at the [FAQ](help/FAQ#clients)
|
||||
|
||||
### Unsupported apps
|
||||
|
||||
#### Android
|
||||
|
||||
- [Fedilab](https://framagit.org/tom79/fedilab) Automatically uses the legacy API, see issue: https://framagit.org/tom79/fedilab/-/issues/520
|
||||
- [Mammut](https://github.com/jamiesanson/Mammut) There are problems with the token request, see issue https://github.com/jamiesanson/Mammut/issues/19
|
||||
|
||||
#### iOS
|
||||
|
||||
- [Mast](https://github.com/Beesitech/Mast) Doesn't accept the entered instance name. Claims that it is invalid (Message is: "Not a valid instance (may be closed or dead)")
|
||||
- [Toot!](https://apps.apple.com/app/toot/id1229021451)
|
||||
Please find a list of supported apps at [FAQ](help/FAQ#clients).
|
||||
|
||||
## Entities
|
||||
|
||||
|
@ -170,7 +156,8 @@ Example:
|
|||
|
||||
- [`GET /api/v1/followed_tags`](https://docs.joinmastodon.org/methods/followed_tags/)
|
||||
- [`GET /api/v1/instance`](https://docs.joinmastodon.org/methods/instance/#v1)
|
||||
- `GET /api/v1/instance/rules` Undocumented, returns Terms of Service
|
||||
- [`GET /api/v1/instance/extended_description`](https://docs.joinmastodon.org/methods/instance/#extended_description)
|
||||
- [`GET /api/v1/instance/rules`](https://docs.joinmastodon.org/methods/instance/#rules)
|
||||
- [`GET /api/v1/instance/peers`](https://docs.joinmastodon.org/methods/instance#list-of-connected-domains)
|
||||
- [`GET /api/v1/lists`](https://docs.joinmastodon.org/methods/timelines/lists/)
|
||||
- [`POST /api/v1/lists`](https://docs.joinmastodon.org/methods/timelines/lists/)
|
||||
|
@ -314,7 +301,6 @@ They refer to features or data that don't exist in Friendica yet.
|
|||
- [`PUT /api/v1/filters/:id`](https://docs.joinmastodon.org/methods/accounts/filters/)
|
||||
- [`DELETE /api/v1/filters/:id`](https://docs.joinmastodon.org/methods/accounts/filters/)
|
||||
- [`GET /api/v1/instance/activity`](https://docs.joinmastodon.org/methods/instance#weekly-activity)
|
||||
- [`POST /api/v1/markers`](https://docs.joinmastodon.org/methods/timelines/markers/)
|
||||
- [`PUT /api/v1/scheduled_statuses/:id`](https://docs.joinmastodon.org/methods/statuses/scheduled_statuses/)
|
||||
- [`GET /api/v1/statuses/{id:\d+}/history`](https://github.com/mastodon/mastodon/pull/16697)
|
||||
- [`GET /api/v1/streaming`](https://docs.joinmastodon.org/methods/timelines/streaming/)
|
||||
|
|
|
@ -178,12 +178,12 @@ The available features are client specific and may differ.
|
|||
#### Android
|
||||
|
||||
* [AndStatus](http://andstatus.org) ([F-Droid](https://f-droid.org/repository/browse/?fdid=org.andstatus.app), [Google Play](https://play.google.com/store/apps/details?id=org.andstatus.app))
|
||||
* [Fedi](https://github.com/Big-Fig/Fediverse.app) ([Google Play](https://play.google.com/store/apps/details?id=com.fediverse.app))
|
||||
* [Fedilab](https://fedilab.app) ([F-Droid](https://f-droid.org/app/fr.gouv.etalab.mastodon), [Google Play](https://play.google.com/store/apps/details?id=app.fedilab.android))
|
||||
* [Friendiqa](https://git.friendi.ca/lubuwest/Friendiqa) ([F-Droid](https://git.friendi.ca/lubuwest/Friendiqa#install), [Google Play](https://play.google.com/store/apps/details?id=org.qtproject.friendiqa))
|
||||
* [Husky](https://git.sr.ht/~captainepoch/husky) ([F-Droid](https://f-droid.org/repository/browse/?fdid=su.xash.husky), [Google Play](https://play.google.com/store/apps/details?id=su.xash.husky))
|
||||
* [Husky](https://codeberg.org/husky/husky) ([F-Droid](https://f-droid.org/repository/browse/?fdid=su.xash.husky), [Google Play](https://play.google.com/store/apps/details?id=su.xash.husky))
|
||||
* [Mastodon](https://github.com/mastodon/mastodon-android) ([F-Droid](https://f-droid.org/en/packages/org.joinmastodon.android/), [Google Play](https://play.google.com/store/apps/details?id=org.joinmastodon.android))
|
||||
* [Subway Tooter](https://github.com/tateisu/SubwayTooter) ([F-Droid](https://android.izzysoft.de/repo/apk/jp.juggler.subwaytooter))
|
||||
* [Pachli](https://pachli.app/) ([F-Droid](https://f-droid.org/en/packages/app.pachli/), [Google Play](https://play.google.com/store/apps/details?id=app.pachli))
|
||||
* [Subway Tooter](https://github.com/tateisu/SubwayTooter) ([F-Droid via Izzy](https://android.izzysoft.de/repo/apk/jp.juggler.subwaytooter.noFcm))
|
||||
* [Tooot](https://tooot.app/) ([Google Play](https://play.google.com/store/apps/details?id=com.xmflsct.app.tooot))
|
||||
* [Tusky](https://tusky.app) ([F-Droid](https://f-droid.org/repository/browse/?fdid=com.keylesspalace.tusky), [Google Play](https://play.google.com/store/apps/details?id=com.keylesspalace.tusky))
|
||||
* [TwidereX](https://github.com/TwidereProject/TwidereX-Android) ([F-Droid](https://f-droid.org/en/packages/com.twidere.twiderex/), [Google Play](https://play.google.com/store/apps/details?id=com.twidere.twiderex))
|
||||
|
@ -193,7 +193,7 @@ The available features are client specific and may differ.
|
|||
|
||||
* [Mastodon](https://joinmastodon.org/apps) ([App Store](https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974))
|
||||
* [Stella*](https://www.stella-app.net/) ([App Store](https://apps.apple.com/us/app/stella-for-mastodon-twitter/id921372048))
|
||||
* [Tooot](https://github.com/tooot-app) ([App Store](https://apps.apple.com/app/id1549772269)
|
||||
* [Tooot](https://github.com/tooot-app) ([App Store](https://apps.apple.com/app/id1549772269))
|
||||
* [TwidereX](https://github.com/TwidereProject/TwidereX-iOS) ([App Store](https://apps.apple.com/app/twidere-x/id1530314034))
|
||||
|
||||
#### Linux
|
||||
|
|
151
doc/themes.md
151
doc/themes.md
|
@ -2,153 +2,10 @@
|
|||
|
||||
* [Home](help)
|
||||
|
||||
To change the look of friendica you have to touch the themes.
|
||||
The current default theme is [Vier](https://github.com/friendica/friendica/tree/stable/view/theme/vier) but there are numerous others.
|
||||
Have a look at [github.com/bkil/friendica-themes](https://github.com/bkil/friendica-themes) for an overview of the existing themes.
|
||||
In case none of them suits your needs, there are several ways to change a theme.
|
||||
The default Theme in Friendica is called [frio](https://github.com/friendica/friendica/tree/stable/view/theme/frio).
|
||||
|
||||
So, how to work on the UI of friendica.
|
||||
Open `Settings > Display > Custom Theme Settings` adjust the Theme to your liking. Select your preferred Appearance - light, dark or black - and your favorite Accent color. Click `Submit` to save your changes.
|
||||
|
||||
You can either directly edit an existing theme.
|
||||
But you might loose your changes when the theme is updated by the friendica team.
|
||||
The `Custom` Appearance allows to tweak the themes CSS and set colors for UI elements. So called `schemestrings` can be shared between users.
|
||||
|
||||
If you are almost happy with an existing theme, the easiest way to cover your needs is to create a new theme, inheriting most of the properties of the parent theme and change just minor stuff.
|
||||
The below for a more detailed description of theme heritage.
|
||||
|
||||
Some themes also allow users to select *variants* of the theme.
|
||||
Those theme variants most often contain an additional [CSS](https://en.wikipedia.org/wiki/CSS) file to override some styling of the default theme values.
|
||||
From the themes in the main repository *vier* and *vier* are using this methods for variations.
|
||||
Quattro is using a slightly different approach.
|
||||
|
||||
Third you can start your theme from scratch.
|
||||
Which is the most complex way to change friendicas look.
|
||||
But it leaves you the most freedom.
|
||||
So below for a *detailed* description and the meaning of some special files.
|
||||
|
||||
### Styling
|
||||
|
||||
If you want to change the styling of a theme, have a look at the themes CSS file.
|
||||
In most cases, you can found these in
|
||||
|
||||
/view/theme/**your-theme-name**/style.css
|
||||
|
||||
sometimes, there is also a file called style.php in the theme directory.
|
||||
This is only needed if the theme allows the user to change certain things of the theme dynamically.
|
||||
Say the font size or set a background image.
|
||||
|
||||
### Templates
|
||||
|
||||
If you want to change the structure of the theme, you need to change the templates used by the theme.
|
||||
Friendica themes are using [SMARTY3](http://www.smarty.net/) for templating.
|
||||
The default template can be found in
|
||||
|
||||
/view/templates
|
||||
|
||||
if you want to override any template within your theme create your version of the template in
|
||||
|
||||
/view/theme/**your-theme-name**/templates
|
||||
|
||||
any template that exists there will be used instead of the default one.
|
||||
|
||||
### JavaScript
|
||||
|
||||
The same rule applies to the JavaScript files found in
|
||||
|
||||
/js
|
||||
|
||||
they will be overwritten by files in
|
||||
|
||||
/view/theme/**your-theme-name**/js.
|
||||
|
||||
## Creating a Theme from Scratch
|
||||
|
||||
Keep patient.
|
||||
Basically what you have to do is identify which template you have to change so it looks more like what you want.
|
||||
Adopt the CSS of the theme accordingly.
|
||||
And iterate the process until you have the theme the way you want it.
|
||||
|
||||
*Use the source Luke.* and don't hesitate to ask in @[developers](https://forum.friendi.ca/profile/developers) or @[helpers](https://forum.friendi.ca/profile/helpers).
|
||||
|
||||
## Special Files
|
||||
|
||||
### unsupported
|
||||
|
||||
If a file with this name (which might be empty) exists in the theme directory, the theme is marked as *unsupported*.
|
||||
An unsupported theme may not be selected by a user in the settings.
|
||||
Users who are already using it wont notice anything.
|
||||
|
||||
### README(.md)
|
||||
|
||||
The contents of this file, with or without the .md which indicates [Markdown](https://daringfireball.net/projects/markdown/) syntax, will be displayed at most repository hosting services and in the theme page within the admin panel of friendica.
|
||||
|
||||
This file should contain information you want to let others know about your theme.
|
||||
|
||||
### screenshot.[png|jpg]
|
||||
|
||||
If you want to have a preview image of your theme displayed in the settings you should take a screenshot and save it with this name.
|
||||
Supported formats are PNG and JPEG.
|
||||
|
||||
### theme.php
|
||||
|
||||
This is the main definition file of the theme.
|
||||
In the header of that file, some meta information is stored.
|
||||
For example, have a look at the theme.php of the *vier* theme:
|
||||
|
||||
<?php
|
||||
/**
|
||||
* [Licence]
|
||||
*
|
||||
* Name: Vier
|
||||
* Version: 1.2
|
||||
* Author: Fabio <http://kirgroup.com/profile/fabrixxm>
|
||||
* Author: Ike <http://pirati.ca/profile/heluecht>
|
||||
* Author: Beanow <https://fc.oscp.info/profile/beanow>
|
||||
* Maintainer: Ike <http://pirati.ca/profile/heluecht>
|
||||
* Description: "Vier" is a very compact and modern theme. It uses the font awesome font library: http://fortawesome.github.com/Font-Awesome/
|
||||
*/
|
||||
|
||||
You see the definition of the theme's name, it's version and the initial author of the theme.
|
||||
These three pieces of information should be listed.
|
||||
If the original author is no longer working on the theme, but a maintainer has taken over, the maintainer should be listed as well.
|
||||
The information from the theme header will be displayed in the admin panel.
|
||||
|
||||
The first thing in file is to import the `App` class from `\Friendica\` namespace.
|
||||
|
||||
use Friendica\App;
|
||||
|
||||
This will make our job a little easier, as we don't have to specify the full name every time we need to use the `App` class.
|
||||
|
||||
The next crucial part of the theme.php file is a definition of an init function.
|
||||
The name of the function is <theme-name>_init.
|
||||
So in the case of vier it is
|
||||
|
||||
function vier_init(App $a) {
|
||||
$a->theme_info = array();
|
||||
$a->set_template_engine('smarty3');
|
||||
}
|
||||
|
||||
Here we have set the basic theme information, in this case they are empty.
|
||||
But the array needs to be set.
|
||||
And we have set the template engine that should be used by friendica for this theme.
|
||||
At the moment you should use the *smarty3* engine.
|
||||
There once was a friendica specific templating engine as well but that is not used anymore.
|
||||
If you like to use another templating engine, please implement it.
|
||||
|
||||
If you want to add something to the HTML header of the theme, one way to do so is by adding it to the theme.php file.
|
||||
To do so, add something alike
|
||||
|
||||
DI::page()['htmlhead'] .= <<< EOT
|
||||
/* stuff you want to add to the header */
|
||||
EOT;
|
||||
|
||||
So you can access the properties of this friendica session from the theme.php file as well.
|
||||
|
||||
### default.php
|
||||
|
||||
This file covers the structure of the underlying HTML layout.
|
||||
The default file is in
|
||||
|
||||
/view/default.php
|
||||
|
||||
if you want to change it, say adding a 4th column for banners of your favourite FLOSS projects, place a new default.php file in your theme directory.
|
||||
As with the theme.php file, you can use the properties of the $a variable with holds the friendica application to decide what content is displayed.
|
||||
In the `General Theme Settings` you can also find the [vier](https://github.com/friendica/friendica/tree/stable/view/theme/vier) Theme, which precedes frio and is no longer officially maintained.
|
||||
|
|
|
@ -278,7 +278,7 @@ function item_process(array $post, array $request, bool $preview, string $return
|
|||
$post['quote-uri-id'] = Item::getQuoteUriId($post['body'], $post['uid']);
|
||||
$post['body'] = BBCode::removeSharedData(Item::setHashtags($post['body']));
|
||||
$post['writable'] = true;
|
||||
$post['sensitive'] = true;
|
||||
$post['sensitive'] = false;
|
||||
|
||||
$o = DI::conversation()->render([$post], Conversation::MODE_SEARCH, false, true);
|
||||
|
||||
|
|
|
@ -376,6 +376,9 @@ class APContact
|
|||
}
|
||||
|
||||
$apcontact['discoverable'] = JsonLD::fetchElement($compacted, 'toot:discoverable', '@value');
|
||||
if (is_null($apcontact['discoverable']) && ($apcontact['type'] == 'Application')) {
|
||||
$apcontact['discoverable'] = false;
|
||||
}
|
||||
|
||||
if (!empty($apcontact['photo'])) {
|
||||
$apcontact['photo'] = Network::addBasePath($apcontact['photo'], $apcontact['url']);
|
||||
|
|
|
@ -1130,7 +1130,7 @@ class Contact
|
|||
{
|
||||
// Always unarchive the relay contact entry
|
||||
if (!empty($contact['batch']) && !empty($contact['term-date']) && ($contact['term-date'] > DBA::NULL_DATETIME)) {
|
||||
$fields = ['failed' => false, 'term-date' => DBA::NULL_DATETIME, 'archive' => false];
|
||||
$fields = ['failed' => false, 'term-date' => DBA::NULL_DATETIME, 'archive' => false, 'unsearchable' => true];
|
||||
$condition = ['uid' => 0, 'network' => Protocol::FEDERATED, 'batch' => $contact['batch'], 'contact-type' => self::TYPE_RELAY];
|
||||
if (!DBA::exists('contact', array_merge($condition, $fields))) {
|
||||
self::update($fields, $condition);
|
||||
|
@ -2819,13 +2819,19 @@ class Contact
|
|||
}
|
||||
|
||||
// We must not try to update relay contacts via probe. They are no real contacts.
|
||||
// See Relay::updateContact() for more details.
|
||||
// We check after the probing to be able to correct falsely detected contact types.
|
||||
if (($contact['contact-type'] == self::TYPE_RELAY) &&
|
||||
if (($contact['contact-type'] == self::TYPE_RELAY) && Strings::compareLink($contact['url'], $contact['baseurl']) &&
|
||||
(!Strings::compareLink($ret['url'], $contact['url']) || in_array($ret['network'], [Protocol::FEED, Protocol::PHANTOM]))
|
||||
) {
|
||||
self::updateContact($id, $uid, $uriid, $contact['url'], ['failed' => false, 'local-data' => $has_local_data, 'last-update' => $updated, 'next-update' => $success_next_update, 'success_update' => $updated]);
|
||||
Logger::info('Not updating relais', ['id' => $id, 'url' => $contact['url']]);
|
||||
return true;
|
||||
if (GServer::reachable($contact)) {
|
||||
self::updateContact($id, $uid, $uriid, $contact['url'], ['failed' => false, 'local-data' => $has_local_data, 'last-update' => $updated, 'next-update' => $success_next_update, 'success_update' => $updated, 'unsearchable' => true]);
|
||||
Logger::info('Not updating relay', ['id' => $id, 'url' => $contact['url']]);
|
||||
return true;
|
||||
}
|
||||
Logger::info('Relay server is not reachable', ['id' => $id, 'url' => $contact['url']]);
|
||||
self::updateContact($id, $uid, $uriid, $contact['url'], ['failed' => true, 'local-data' => $has_local_data, 'last-update' => $updated, 'next-update' => $failed_next_update, 'failure_update' => $updated, 'unsearchable' => true]);
|
||||
return false;
|
||||
}
|
||||
|
||||
// If Probe::uri fails the network code will be different ("feed" or "unkn")
|
||||
|
|
|
@ -43,6 +43,7 @@ class Federation extends BaseAdmin
|
|||
'birdsitelive' => ['name' => 'BirdsiteLIVE', 'color' => '#1b6ec2'], // Color from the page
|
||||
'bookwyrm' => ['name' => 'BookWyrm', 'color' => '#00d1b2'], // Color from the page
|
||||
'castopod' => ['name' => 'Castopod', 'color' => '#00564a'], // Background color from the page
|
||||
'cherrypick' => ['name' => 'Cherrypick', 'color' => 'pink'], // Color from one of the instabces
|
||||
'diaspora' => ['name' => 'Diaspora', 'color' => '#a1a1a1'], // logo is black and white, makes a gray
|
||||
'calckey' => ['name' => 'firefish (Calckey)', 'color' => '#1c4a5c'], // Color from the page
|
||||
'sharkey' => ['name' => 'Sharkey', 'color' => 'lightpink'], // Font color from the homepage
|
||||
|
@ -58,6 +59,7 @@ class Federation extends BaseAdmin
|
|||
'kbin' => ['name' => 'kbin', 'color' => '#61366b'], // Color from their main instance
|
||||
'lemmy' => ['name' => 'Lemmy', 'color' => '#00c853'], // Green from the page
|
||||
'mastodon' => ['name' => 'Mastodon', 'color' => '#1a9df9'], // blue from the Mastodon logo
|
||||
'mbin' => ['name' => 'mbin', 'color' => '#3c3c3c'], // Color from one of their instances
|
||||
'microblog' => ['name' => 'Microblog', 'color' => '#fdb52b'], // Color from the page
|
||||
'misskey' => ['name' => 'Misskey', 'color' => '#ccfefd'], // Font color of the homepage
|
||||
'mobilizon' => ['name' => 'Mobilizon', 'color' => '#ffd599'], // Background color of parts of the homepage
|
||||
|
|
|
@ -178,11 +178,11 @@ class Timeline extends BaseModule
|
|||
protected function getNoSharerWidget(string $base): string
|
||||
{
|
||||
$path = $this->selectedTab;
|
||||
if (!empty($this->accountTypeString)) {
|
||||
$path .= '/' . $this->accountTypeString;
|
||||
}
|
||||
$query_parameters = [];
|
||||
|
||||
$query_parameters = [];
|
||||
if (!empty($this->accountTypeString)) {
|
||||
$query_parameters['accounttype'] = $this->accountTypeString;
|
||||
}
|
||||
if (!empty($this->minId)) {
|
||||
$query_parameters['min_id'] = $this->minId;
|
||||
}
|
||||
|
|
|
@ -118,7 +118,8 @@ class Probe
|
|||
'following', 'followers', 'inbox', 'outbox', 'sharedinbox',
|
||||
'priority', 'network', 'pubkey', 'manually-approve', 'baseurl', 'gsid'];
|
||||
|
||||
$numeric_fields = ['gsid', 'hide', 'account-type', 'manually-approve'];
|
||||
$numeric_fields = ['gsid', 'account-type'];
|
||||
$boolean_fields = ['hide', 'manually-approve'];
|
||||
|
||||
if (!empty($data['photo'])) {
|
||||
$data['photo'] = Network::addBasePath($data['photo'], $data['url']);
|
||||
|
@ -134,10 +135,12 @@ class Probe
|
|||
if (isset($data[$field])) {
|
||||
if (in_array($field, $numeric_fields)) {
|
||||
$newdata[$field] = (int)$data[$field];
|
||||
} elseif (in_array($field, $boolean_fields)) {
|
||||
$newdata[$field] = (bool)$data[$field];
|
||||
} else {
|
||||
$newdata[$field] = trim($data[$field]);
|
||||
}
|
||||
} elseif (!in_array($field, $numeric_fields)) {
|
||||
} elseif (!in_array($field, $numeric_fields) && !in_array($field, $boolean_fields)) {
|
||||
$newdata[$field] = '';
|
||||
} else {
|
||||
$newdata[$field] = null;
|
||||
|
|
|
@ -338,16 +338,13 @@ class Delivery
|
|||
if ($public_dfrn) {
|
||||
Logger::info('Relay delivery to ' . $contact['url'] . ' with guid ' . $target_item['guid'] . ' returns ' . $deliver_status);
|
||||
|
||||
if ($cmd == Delivery::POST) {
|
||||
if (($deliver_status >= 200) && ($deliver_status <= 299)) {
|
||||
Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
|
||||
$success = ($deliver_status >= 200) && ($deliver_status <= 299);
|
||||
|
||||
GServer::setProtocol($contact['gsid'] ?? 0, $protocol);
|
||||
$success = true;
|
||||
} else {
|
||||
Post\DeliveryData::incrementQueueFailed($target_item['uri-id']);
|
||||
$success = false;
|
||||
}
|
||||
if ($cmd == Delivery::POST) {
|
||||
Post\DeliveryData::incrementQueueDone($target_item['uri-id'], $protocol);
|
||||
GServer::setProtocol($contact['gsid'] ?? 0, $protocol);
|
||||
} else {
|
||||
Post\DeliveryData::incrementQueueFailed($target_item['uri-id']);
|
||||
}
|
||||
return $success;
|
||||
}
|
||||
|
|
|
@ -246,13 +246,14 @@ class Relay
|
|||
$fields['contact-type'] = Contact::TYPE_RELAY;
|
||||
Logger::info('Assigning missing data for relay contact', ['server' => $gserver['url'], 'id' => $old['id']]);
|
||||
}
|
||||
} elseif (empty($fields)) {
|
||||
} elseif (empty($fields) && $old['unsearchable']) {
|
||||
Logger::info('No content to update, quitting', ['server' => $gserver['url']]);
|
||||
return;
|
||||
}
|
||||
|
||||
if (DBA::isResult($old)) {
|
||||
$fields['updated'] = DateTimeFormat::utcNow();
|
||||
$fields['updated'] = DateTimeFormat::utcNow();
|
||||
$fields['unsearchable'] = true;
|
||||
|
||||
Logger::info('Update relay contact', ['server' => $gserver['url'], 'id' => $old['id'], 'fields' => $fields]);
|
||||
Contact::update($fields, ['id' => $old['id']], $old);
|
||||
|
@ -265,6 +266,7 @@ class Relay
|
|||
'rel' => Contact::FOLLOWER, 'blocked' => false,
|
||||
'pending' => false, 'writable' => true,
|
||||
'gsid' => $gserver['id'],
|
||||
'unsearchable' => true,
|
||||
'baseurl' => $gserver['url'], 'contact-type' => Contact::TYPE_RELAY];
|
||||
|
||||
$fields = array_merge($default, $fields);
|
||||
|
|
|
@ -56,7 +56,7 @@ use Friendica\Database\DBA;
|
|||
|
||||
// This file is required several times during the test in DbaDefinition which justifies this condition
|
||||
if (!defined('DB_UPDATE_VERSION')) {
|
||||
define('DB_UPDATE_VERSION', 1556);
|
||||
define('DB_UPDATE_VERSION', 1557);
|
||||
}
|
||||
|
||||
return [
|
||||
|
|
11
update.php
11
update.php
|
@ -63,6 +63,7 @@ use Friendica\Protocol\Activity;
|
|||
use Friendica\Protocol\Delivery;
|
||||
use Friendica\Security\PermissionSet\Repository\PermissionSet;
|
||||
use Friendica\Util\DateTimeFormat;
|
||||
use Friendica\Worker\UpdateContact;
|
||||
|
||||
// Post-update script of PR 5751
|
||||
function update_1298()
|
||||
|
@ -1447,3 +1448,13 @@ function update_1556()
|
|||
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
||||
function update_1557()
|
||||
{
|
||||
$contacts = DBA::select('account-view', ['id'], ['platform' => 'friendica', 'contact-type' => Contact::TYPE_RELAY]);
|
||||
while ($contact = DBA::fetch($contacts)) {
|
||||
UpdateContact::add(Worker::PRIORITY_LOW, $contact['id']);
|
||||
}
|
||||
DBA::close($contacts);
|
||||
return Update::SUCCESS;
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue