Merge remote-tracking branch 'upstream/develop' into api-edit

This commit is contained in:
Michael 2023-03-03 03:56:19 +00:00
commit 9e4753f440
5 changed files with 148 additions and 129 deletions

View file

@ -116,8 +116,8 @@ class Account extends BaseDataTransferObject
$this->following_count = $account['ap-following_count'] ?? $account['diaspora-interacting_count'] ?? 0; $this->following_count = $account['ap-following_count'] ?? $account['diaspora-interacting_count'] ?? 0;
$this->statuses_count = $account['ap-statuses_count'] ?? $account['diaspora-post_count'] ?? 0; $this->statuses_count = $account['ap-statuses_count'] ?? $account['diaspora-post_count'] ?? 0;
$lastItem = $account['last-item'] ?: DBA::NULL_DATETIME; $lastItem = $account['last-item'] ? DateTimeFormat::utc($account['last-item'], 'Y-m-d') : DBA::NULL_DATETIME;
$this->last_status_at = $lastItem != DBA::NULL_DATETIME ? DateTimeFormat::utc($lastItem, 'Y-m-d') : null; $this->last_status_at = $lastItem != DBA::NULL_DATETIME ? DateTimeFormat::utc($lastItem, DateTimeFormat::JSON) : null;
// No custom emojis per account in Friendica // No custom emojis per account in Friendica
$this->emojis = []; $this->emojis = [];

View file

@ -110,8 +110,8 @@ class Status extends BaseDataTransferObject
public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $in_reply, array $reblog, FriendicaExtension $friendica, array $quote = null, array $poll = null) public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $in_reply, array $reblog, FriendicaExtension $friendica, array $quote = null, array $poll = null)
{ {
$this->id = (string)$item['uri-id']; $this->id = (string)$item['uri-id'];
$this->created_at = $item['created']; $this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::JSON);
$this->edited_at = $item['edited']; $this->edited_at = DateTimeFormat::utc($item['edited'], DateTimeFormat::JSON);
if ($item['gravity'] == Item::GRAVITY_COMMENT) { if ($item['gravity'] == Item::GRAVITY_COMMENT) {
$this->in_reply_to_id = (string)$item['thr-parent-id']; $this->in_reply_to_id = (string)$item['thr-parent-id'];

View file

@ -22,6 +22,7 @@
namespace Friendica\Object\Api\Mastodon\Status; namespace Friendica\Object\Api\Mastodon\Status;
use Friendica\BaseDataTransferObject; use Friendica\BaseDataTransferObject;
use Friendica\Util\DateTimeFormat;
/** /**
* Class FriendicaExtension * Class FriendicaExtension
@ -70,9 +71,9 @@ class FriendicaExtension extends BaseDataTransferObject
FriendicaDeliveryData $delivery_data FriendicaDeliveryData $delivery_data
) { ) {
$this->title = $title; $this->title = $title;
$this->changed_at = $changed_at; $this->changed_at = $changed_at ? DateTimeFormat::utc($changed_at, DateTimeFormat::JSON) : null;
$this->commented_at = $commented_at; $this->commented_at = $commented_at ? DateTimeFormat::utc($commented_at, DateTimeFormat::JSON) : null;
$this->received_at = $received_at; $this->received_at = $received_at ? DateTimeFormat::utc($received_at, DateTimeFormat::JSON) : null;
$this->delivery_data = $delivery_data; $this->delivery_data = $delivery_data;
$this->dislikes_count = $dislikes_count; $this->dislikes_count = $dislikes_count;
} }

View file

@ -1994,6 +1994,18 @@ code > .hl-main {
.wall-item-actions-right { .wall-item-actions-right {
display: flex; display: flex;
} }
.wall-item-actions-items {
flex-grow: 1;
}
.wall-item-actions-row {
display: flex;
}
.wall-item-actions-row .btn {
width: 100%;
}
.wall-item-actions-row > * {
flex: 1 1 0;
}
.wall-item-actions .checkbox { .wall-item-actions .checkbox {
margin: 0 0 0 15px; margin: 0 0 0 15px;
} }
@ -2001,14 +2013,17 @@ code > .hl-main {
.wall-item-actions .btn, .wall-item-actions .btn,
.wall-item-actions a, .wall-item-actions a,
.wall-item-actions button { .wall-item-actions button {
padding-right: 12px; padding-right: 0;
padding-left: 12px; padding-left: 0;
} }
.wall-item-actions .checkbox { .wall-item-actions .checkbox {
margin-top: 8px; margin-top: 8px;
flex: 0 1 auto;
} }
.wall-item-actions .like-rotator { .wall-item-actions .like-rotator {
padding-top: 8px; position: absolute;
top: 8px;
right: 0;
} }
} }
.wall-item-actions button:hover { .wall-item-actions button:hover {

View file

@ -436,7 +436,8 @@ as the value of $top_child_total (this is done at the end of this file)
</span> </span>
</span> </span>
<div class="btn-toolbar btn-group visible-xs" role="group"> <div class="wall-item-actions-items btn-toolbar btn-group visible-xs" role="group">
<div class="wall-item-actions-row">
{{* Buttons for like and dislike *}} {{* Buttons for like and dislike *}}
{{if $item.vote}} {{if $item.vote}}
{{if $item.vote.like}} {{if $item.vote.like}}
@ -478,19 +479,20 @@ as the value of $top_child_total (this is done at the end of this file)
</a> </a>
</li> </li>
{{/if}} {{/if}}
{{if $item.browsershare}}
<li role="menuitem">
<button type="button" class="btn-link button-browser-share" onclick="navigator.share({url: '{{$item.plink.orig}}'})" title="{{$item.browsershare.1}}">
<i class="fa fa-share-alt" aria-hidden="true"></i> {{$item.browsershare.0}}
</button>
</li>
{{/if}}
</ul> </ul>
</div> </div>
{{/if}} {{/if}}
{{if $item.browsershare}}
<button type="button" class="btn button-browser-share" onclick="navigator.share({url: '{{$item.plink.orig}}'})" title="{{$item.browsershare.1}}"><i class="fa fa-share-alt"></i></button>
{{/if}}
{{* Put additional actions in a dropdown menu *}} {{* Put additional actions in a dropdown menu *}}
<img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" /> <img id="like-rotator-{{$item.id}}" class="like-rotator" src="images/rotator.gif" alt="{{$item.wait}}" title="{{$item.wait}}" style="display: none;" />
</div>
<div class="wall-item-actions-right visible-xs">
{{* Event attendance buttons *}} {{* Event attendance buttons *}}
{{if $item.isevent}} {{if $item.isevent}}
<div class="btn-group" role="group"> <div class="btn-group" role="group">
@ -577,6 +579,7 @@ as the value of $top_child_total (this is done at the end of this file)
{{/if}} {{/if}}
</span> </span>
</div> </div>
</div>
</div><!--./wall-item-actions--> </div><!--./wall-item-actions-->
<div class="wall-item-links"></div> <div class="wall-item-links"></div>