Compare commits

...

10 commits

Author SHA1 Message Date
Jakobus Schürz
486b7caa46 add darkfeature "new posting" on rightclick and label on create button 2024-03-08 15:49:24 +01:00
Hypolite Petovan
013bba50bc
Merge pull request #13975 from annando/check-content-type
Check for the content type before fetching the content
2024-03-07 21:58:43 -05:00
Michael
5f0657a30c Don't show the body in the log 2024-03-07 22:29:04 +00:00
Michael
435b30be11 Check for the content type before fetching the content 2024-03-07 22:16:52 +00:00
Hypolite Petovan
73863561d2
Merge pull request #13974 from annando/videoheight
Set default value for max video height
2024-03-07 09:33:11 -05:00
Michael
67696d08da Set default value for max video height 2024-03-07 14:22:40 +00:00
Hypolite Petovan
1b00b91767
Merge pull request #13973 from annando/parent-activity
Change the last activity for delegation parents and siblings as well
2024-03-07 09:02:46 -05:00
Michael
68c2bdb98e Change the last activity for delegation parents and siblings as well 2024-03-07 06:12:36 +00:00
Michael Vogel
54852ecb56
Merge pull request #13970 from MrPetovan/bug/warnings
Address a couple of warnings
2024-03-06 20:13:40 +01:00
Hypolite Petovan
8c4b2107b5 Include author-alias to the field list in mod/photos
- It's used to generate magic links of authors of comments on photos
- Address https://github.com/friendica/friendica/issues/13761#issuecomment-1980738080
2024-03-06 12:07:43 -05:00
12 changed files with 31 additions and 19 deletions

View file

@ -1039,7 +1039,7 @@ function photos_content(App $a)
$pager = new Pager(DI::l10n(), DI::args()->getQueryString());
$params = ['order' => ['id'], 'limit' => [$pager->getStart(), $pager->getItemsPerPage()]];
$items = Post::toArray(Post::selectForUser($link_item['uid'], Item::ITEM_FIELDLIST, $condition, $params));
$items = Post::toArray(Post::selectForUser($link_item['uid'], array_merge(Item::ITEM_FIELDLIST, ['author-alias']), $condition, $params));
if (DI::userSession()->getLocalUserId() == $link_item['uid']) {
Item::update(['unseen' => false], ['parent' => $link_item['parent']]);

View file

@ -362,6 +362,7 @@ class Conversation
$tpl = Renderer::getMarkupTemplate('jot.tpl');
$o .= Renderer::replaceMacros($tpl, [
'$post' => $this->l10n->t($x['content'] ? 'Post to group' : 'Post'),
'$new_post' => $this->l10n->t('New Post'),
'$return_path' => $this->args->getQueryString(),
'$action' => 'item',

View file

@ -34,10 +34,11 @@ use Friendica\Core\Protocol;
use Friendica\Core\Renderer;
use Friendica\Core\System;
use Friendica\Core\Worker;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
use Friendica\Model\Post\Category;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPClient\Client\HttpClientOptions;
use Friendica\Network\HTTPException\InternalServerErrorException;
use Friendica\Network\HTTPException\ServiceUnavailableException;
use Friendica\Protocol\Activity;
@ -45,6 +46,7 @@ use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Delivery;
use Friendica\Protocol\Diaspora;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\HTTPSignature;
use Friendica\Util\Map;
use Friendica\Util\Network;
use Friendica\Util\Proxy;
@ -3644,7 +3646,7 @@ class Item
if ($PostMedia->mimetype->type == 'video') {
if (($PostMedia->height ?? 0) > ($PostMedia->width ?? 0)) {
$height = min(DI::config()->get('system', 'max_video_height'), $PostMedia->height);
$height = min(DI::config()->get('system', 'max_video_height') ?: '100%', $PostMedia->height);
$width = 'auto';
} else {
$height = 'auto';
@ -4094,9 +4096,12 @@ class Item
return is_numeric($hookData['item_id']) ? $hookData['item_id'] : 0;
}
$fetched_uri = ActivityPub\Processor::fetchMissingActivity($uri, [], '', $completion, $uid);
$curlResult = DI::httpClient()->head($uri, [HttpClientOptions::ACCEPT_CONTENT => HttpClientAccept::JSON_AS]);
if (HTTPSignature::isValidContentType($curlResult->getContentType())) {
$fetched_uri = ActivityPub\Processor::fetchMissingActivity($uri, [], '', $completion, $uid);
}
if ($fetched_uri) {
if (!empty($fetched_uri)) {
$item_id = self::searchByLink($fetched_uri, $uid);
} else {
$item_id = Diaspora::fetchByURL($uri);

View file

@ -846,6 +846,11 @@ class User
self::update($fields, $user['uid']);
// Set the last activity for all identities of the user
DBA::update('user', $fields, ['parent-uid' => $user['uid'], 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
if (!empty($user['parent-uid'])) {
self::update($fields, $user['parent-uid']);
DBA::update('user', $fields, ['parent-uid' => $user['parent-uid'], 'verified' => true, 'blocked' => false, 'account_removed' => false, 'account_expired' => false]);
}
}
/**

View file

@ -1610,7 +1610,7 @@ class Processor
}
if (empty($object) || !is_array($object)) {
Logger::notice('Invalid JSON data', ['url' => $url, 'content-type' => $curlResult->getContentType(), 'body' => $body]);
Logger::notice('Invalid JSON data', ['url' => $url, 'content-type' => $curlResult->getContentType()]);
return '';
}

View file

@ -104,7 +104,7 @@ class OAuth
}
Logger::debug('Token found', $token);
$user = User::getById($token['uid'], ['uid', 'last-activity', 'login_date']);
$user = User::getById($token['uid'], ['uid', 'parent-uid', 'last-activity', 'login_date']);
if (!empty($user)) {
User::updateLastActivity($user, false);
}

View file

@ -407,6 +407,10 @@ return [
// Maximum recursion depth when fetching posts until the job is delegated to a worker task or finished.
'max_recursion_depth' => 50,
// max_video_height (Integer)
// Maximum height of videos in portrait mode.
'max_video_height' => 640,
// memcache_host (String)
// Host name of the memcache daemon.
'memcache_host' => '127.0.0.1',

View file

@ -84,8 +84,6 @@ $(document).ready(function () {
let $mentionButton = $("#mention-link-button");
if ($mentionButton.length) {
$mentionButton.appendTo("#topbar-second > .container > #navbar-button").addClass("pull-right");
$("#mention-link").addClass("btn-sm ");
$("#mention-link > span i").addClass("fa-2x");
if ($mentionButton.hasClass("modal-open")) {
$mentionButton.on("click", function (e) {
e.preventDefault();

View file

@ -1,5 +1,5 @@
{{* The button to open the jot - in This theme we move the button with js to the second nav bar *}}
<a class="btn btn-sm btn-primary pull-right{{if !$always_open_compose}} modal-open{{/if}}" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o fa-2x"></i></a>
<a class="btn btn-primary pull-right{{if !$always_open_compose}} modal-open{{/if}}" id="jotOpen" href="compose/{{$posttype}}{{if $content}}?body={{$content}}{{/if}}" aria-label="{{$new_post}}" title="{{$new_post}}"><i class="fa fa-pencil-square-o"></i><span class="">{{$post}}</span></a>
<div id="jot-content">
<div id="jot-sections">

View file

@ -70,13 +70,12 @@
</button>
</div>
{{/if}}
{{if $profile.addr}}
<div id="mention-link-button">
<button type="button" id="mention-link" class="btn btn-labeled btn-primary" onclick="openWallMessage('{{$mention_url}}')">
<span class=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{$mention_label}}</span>
</button>
</div>
{{if $profile.addr}}
<div id="mention-link-button">
<button type="button" id="mention-link" class="btn btn-labeled btn-primary" onclick="openWallMessage('{{$mention_url}}')" oncontextmenu="openWallMessage('compose/0'); return false;">
<span class=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{$mention_label}}</span>
</div>
{{/if}}
{{if $network_label}}
<div id="showgroup-button">

View file

@ -26,4 +26,4 @@
</div>
</div>
</div>
</fieldset>
</fieldset>

View file

@ -58,7 +58,7 @@
{{/if}}
{{if $mention_link}}
<div id="mention-link-button">
<button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="openWallMessage('{{$mention_link}}')" title="{{$mention}}" aria-label="{{$mention}}">
<button type="button" id="mention-link" class="btn btn-labeled btn-primary{{if !$always_open_compose}} modal-open{{/if}}" onclick="openWallMessage('{{$mention_link}}')" oncontextmenu="openWallMessage('compose/0'); return false;" title="{{$mention}}" aria-label="{{$mention}}">
<span class=""><i class="fa fa-pencil-square-o"></i></span>
<span class="">{{$mention}}</span>
</button>