mirror of
https://github.com/friendica/friendica
synced 2025-04-19 08:30:11 +00:00
Merge remote-tracking branch 'upstream/develop' into app-user2
This commit is contained in:
commit
4495e83eca
36 changed files with 446 additions and 312 deletions
|
@ -186,7 +186,7 @@ class Statuses extends BaseApi
|
|||
if (!empty($request['scheduled_at'])) {
|
||||
$item['guid'] = Item::guid($item, true);
|
||||
$item['uri'] = Item::newURI($item['uid'], $item['guid']);
|
||||
$id = Post\Delayed::add($item['uri'], $item, PRIORITY_HIGH, false, $request['scheduled_at']);
|
||||
$id = Post\Delayed::add($item['uri'], $item, PRIORITY_HIGH, Post\Delayed::PREPARED, $request['scheduled_at']);
|
||||
if (empty($id)) {
|
||||
DI::mstdnError()->InternalError();
|
||||
}
|
||||
|
|
|
@ -607,6 +607,8 @@ class Contact extends BaseModule
|
|||
'$location_label' => DI::l10n()->t('Location:'),
|
||||
'$xmpp' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['xmpp']),
|
||||
'$xmpp_label' => DI::l10n()->t('XMPP:'),
|
||||
'$matrix' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['matrix']),
|
||||
'$matrix_label' => DI::l10n()->t('Matrix:'),
|
||||
'$about' => BBCode::convertForUriId($contact['uri-id'] ?? 0, $contact['about'], BBCode::EXTERNAL),
|
||||
'$about_label' => DI::l10n()->t('About:'),
|
||||
'$keywords' => $contact['keywords'],
|
||||
|
|
|
@ -120,7 +120,7 @@ class NoScrape extends BaseModule
|
|||
$json_info['last-activity'] = date('o-W', $last_active);
|
||||
|
||||
//These are optional fields.
|
||||
$profile_fields = ['about', 'locality', 'region', 'postal-code', 'country-name'];
|
||||
$profile_fields = ['about', 'locality', 'region', 'postal-code', 'country-name', 'xmpp', 'matrix'];
|
||||
foreach ($profile_fields as $field) {
|
||||
if (!empty($profile[$field])) {
|
||||
$json_info["$field"] = $profile[$field];
|
||||
|
|
|
@ -176,6 +176,10 @@ class Profile extends BaseProfile
|
|||
$basic_fields += self::buildField('xmpp', DI::l10n()->t('XMPP:'), $profile['xmpp']);
|
||||
}
|
||||
|
||||
if ($profile['matrix']) {
|
||||
$basic_fields += self::buildField('matrix', DI::l10n()->t('Matrix:'), $profile['matrix']);
|
||||
}
|
||||
|
||||
if ($profile['homepage']) {
|
||||
$basic_fields += self::buildField('homepage', DI::l10n()->t('Homepage:'), HTML::toLink($profile['homepage']));
|
||||
}
|
||||
|
|
|
@ -92,6 +92,7 @@ class Index extends BaseSettings
|
|||
$pub_keywords = self::cleanKeywords(Strings::escapeTags(trim($_POST['pub_keywords'])));
|
||||
$prv_keywords = self::cleanKeywords(Strings::escapeTags(trim($_POST['prv_keywords'])));
|
||||
$xmpp = Strings::escapeTags(trim($_POST['xmpp']));
|
||||
$matrix = Strings::escapeTags(trim($_POST['matrix']));
|
||||
$homepage = Strings::escapeTags(trim($_POST['homepage']));
|
||||
if ((strpos($homepage, 'http') !== 0) && (strlen($homepage))) {
|
||||
// neither http nor https in URL, add them
|
||||
|
@ -120,6 +121,7 @@ class Index extends BaseSettings
|
|||
'postal-code' => $postal_code,
|
||||
'country-name' => $country_name,
|
||||
'xmpp' => $xmpp,
|
||||
'matrix' => $matrix,
|
||||
'homepage' => $homepage,
|
||||
'pub_keywords' => $pub_keywords,
|
||||
'prv_keywords' => $prv_keywords,
|
||||
|
@ -240,6 +242,7 @@ class Index extends BaseSettings
|
|||
'$country_name' => ['country_name', DI::l10n()->t('Country:'), $profile['country-name']],
|
||||
'$age' => ((intval($profile['dob'])) ? '(' . DI::l10n()->t('Age: ') . DI::l10n()->tt('%d year old', '%d years old', Temporal::getAgeByTimezone($profile['dob'], $profile['timezone'])) . ')' : ''),
|
||||
'$xmpp' => ['xmpp', DI::l10n()->t('XMPP (Jabber) address:'), $profile['xmpp'], DI::l10n()->t('The XMPP address will be propagated to your contacts so that they can follow you.')],
|
||||
'$matrix' => ['matrix', DI::l10n()->t('Matrix (Element) address:'), $profile['matrix'], DI::l10n()->t('The Matrix address will be published so that people can follow you there.')],
|
||||
'$homepage' => ['homepage', DI::l10n()->t('Homepage URL:'), $profile['homepage']],
|
||||
'$pub_keywords' => ['pub_keywords', DI::l10n()->t('Public Keywords:'), $profile['pub_keywords'], DI::l10n()->t('(Used for suggesting potential friends, can be seen by others)')],
|
||||
'$prv_keywords' => ['prv_keywords', DI::l10n()->t('Private Keywords:'), $profile['prv_keywords'], DI::l10n()->t('(Used for searching profiles, never shown to others)')],
|
||||
|
|
|
@ -47,7 +47,7 @@ class Xrd extends BaseModule
|
|||
}
|
||||
|
||||
$uri = urldecode(Strings::escapeTags(trim($_GET['uri'])));
|
||||
if (($_SERVER['HTTP_ACCEPT'] ?? '') == 'application/jrd+json') {
|
||||
if (strpos($_SERVER['HTTP_ACCEPT'] ?? '', 'application/jrd+json') !== false) {
|
||||
$mode = 'json';
|
||||
} else {
|
||||
$mode = 'xml';
|
||||
|
@ -58,7 +58,7 @@ class Xrd extends BaseModule
|
|||
}
|
||||
|
||||
$uri = urldecode(Strings::escapeTags(trim($_GET['resource'])));
|
||||
if (($_SERVER['HTTP_ACCEPT'] ?? '') == 'application/xrd+xml') {
|
||||
if (strpos($_SERVER['HTTP_ACCEPT'] ?? '', 'application/xrd+xml') !== false) {
|
||||
$mode = 'xml';
|
||||
} else {
|
||||
$mode = 'json';
|
||||
|
@ -159,9 +159,6 @@ class Xrd extends BaseModule
|
|||
{
|
||||
$salmon_key = Salmon::salmonKey($owner['spubkey']);
|
||||
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
header('Content-type: application/json; charset=utf-8');
|
||||
|
||||
$json = [
|
||||
'subject' => 'acct:' . $owner['addr'],
|
||||
'aliases' => [
|
||||
|
@ -235,8 +232,8 @@ class Xrd extends BaseModule
|
|||
],
|
||||
];
|
||||
|
||||
echo json_encode($json);
|
||||
exit();
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
System::jsonExit($json, 'application/jrd+json; charset=utf-8');
|
||||
}
|
||||
|
||||
private static function printXML($alias, $baseURL, $user, $owner, $avatar)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue