1
0
Fork 0

Merge pull request #6613 from MrPetovan/task/6238-add-delivery-done

Add "delivery done" label
This commit is contained in:
Michael Vogel 2019-02-09 06:57:04 +01:00 committed by GitHub
commit fecfcd5025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2218 additions and 2178 deletions

View file

@ -432,6 +432,7 @@ class Post extends BaseObject
'delivery_pending' => L10n::t('Delivery to remote servers is pending'), 'delivery_pending' => L10n::t('Delivery to remote servers is pending'),
'delivery_underway' => L10n::t('Delivery to remote servers is underway'), 'delivery_underway' => L10n::t('Delivery to remote servers is underway'),
'delivery_almost' => L10n::t('Delivery to remote servers is mostly done'), 'delivery_almost' => L10n::t('Delivery to remote servers is mostly done'),
'delivery_done' => L10n::t('Delivery to remote servers is done'),
], ],
]; ];

View file

@ -41,12 +41,11 @@ class APDelivery extends BaseObject
$data = ActivityPub\Transmitter::createCachedActivityFromItem($target_id); $data = ActivityPub\Transmitter::createCachedActivityFromItem($target_id);
if (!empty($data)) { if (!empty($data)) {
$success = HTTPSignature::transmit($data, $inbox, $uid); $success = HTTPSignature::transmit($data, $inbox, $uid);
}
if ($success && in_array($cmd, [Delivery::POST, Delivery::COMMENT])) { if ($success && in_array($cmd, [Delivery::POST, Delivery::COMMENT])) {
ItemDeliveryData::incrementQueueDone($target_id); ItemDeliveryData::incrementQueueDone($target_id);
} }
} }
}
if (!$success) { if (!$success) {
Worker::defer(); Worker::defer();

File diff suppressed because it is too large Load diff

View file

@ -11,8 +11,10 @@
{{$delivery.delivery_pending}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}} {{$delivery.delivery_pending}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
{{elseif $delivery.queue_done / $delivery.queue_count < 0.75}} {{elseif $delivery.queue_done / $delivery.queue_count < 0.75}}
{{$delivery.delivery_underway}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}} {{$delivery.delivery_underway}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
{{else}} {{elseif $delivery.queue_done < $delivery.queue_count}}
{{$delivery.delivery_almost}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}} {{$delivery.delivery_almost}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
{{else}}
{{$delivery.delivery_done}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}
{{/if}} {{/if}}
</span> </span>
{{/if}} {{/if}}

View file

@ -10,9 +10,12 @@
{{elseif $delivery.queue_done / $delivery.queue_count < 0.75}} {{elseif $delivery.queue_done / $delivery.queue_count < 0.75}}
<i class="fa fa-paper-plane-o" aria-hidden="true" title="{{$delivery.delivery_underway}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i> <i class="fa fa-paper-plane-o" aria-hidden="true" title="{{$delivery.delivery_underway}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
<span class="sr-only">{{$delivery.delivery_underway}}</span> <span class="sr-only">{{$delivery.delivery_underway}}</span>
{{else}} {{elseif $delivery.queue_done < $delivery.queue_count}}
<i class="fa fa-paper-plane" aria-hidden="true" title="{{$delivery.delivery_almost}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i> <i class="fa fa-paper-plane" aria-hidden="true" title="{{$delivery.delivery_almost}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
<span class="sr-only">{{$delivery.delivery_almost}}</span> <span class="sr-only">{{$delivery.delivery_almost}}</span>
{{else}}
<i class="fa fa-paper-plane" aria-hidden="true" title="{{$delivery.delivery_done}} {{$item.delivery.queue_done}}/{{$item.delivery.queue_count}}"></i>
<span class="sr-only">{{$delivery.delivery_done}}</span>
{{/if}} {{/if}}
</span> </span>
{{/if}} {{/if}}