[frio] Add connector-based privacy display

This commit is contained in:
Hypolite Petovan 2022-01-09 12:17:34 -05:00
parent 5b8f78f728
commit 18b32b68aa
4 changed files with 10 additions and 3 deletions

View file

@ -80,7 +80,7 @@ class Item
'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink',
'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language',
'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object',
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention',
'allow_cid', 'allow_gid', 'deny_cid', 'deny_gid', 'mention', 'global',
'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network',
'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type',
'causer-id', 'causer-link', 'causer-name', 'causer-avatar', 'causer-contact-type', 'causer-network',

View file

@ -177,6 +177,8 @@ class Post
? DI::l10n()->t('Private Message')
: false);
$connector = !$item['global'] ? DI::l10n()->t('Connector Message') : false;
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE;
$announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]);
@ -469,6 +471,7 @@ class Post
'app' => $item['app'],
'created' => $ago,
'lock' => $lock,
'connector' => $connector,
'location_html' => $location_html,
'indent' => $indent,
'shiny' => $shiny,

View file

@ -63,8 +63,9 @@
<span class="navicon lock fakelink" onClick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}">
&nbsp;<small><i class="fa fa-lock" aria-hidden="true"></i></small>
</span>
{{elseif $item.connector}}
<span class="fa fa-lock" title="{{$item.connector}}"></span>
{{/if}}
<div class="additional-info text-muted">
<div id="wall-item-ago-{{$item.id}}" class="wall-item-ago">
<small>

View file

@ -63,7 +63,8 @@ as the value of $top_child_total (this is done at the end of this file)
{{if $item.star}}
<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>
{{/if}}
{{if $item.lock}}<span class="navicon lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}"></span><span class="fa fa-lock"></span>{{/if}}
{{if $item.lock}}<span class="navicon lock fakelink" onclick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}"></span><span class="fa fa-lock"></span>
{{elseif $item.connector}}<span class="fa fa-lock" title="{{$item.connector}}"></span>{{/if}}
</div>
{{* /TODO => Unknown block *}}
@ -161,6 +162,8 @@ as the value of $top_child_total (this is done at the end of this file)
<span class="navicon lock fakelink" onClick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}" data-toggle="tooltip">
&nbsp;<small><i class="fa fa-lock" aria-hidden="true"></i></small>
</span>
{{elseif $item.connector}}
<small><i class="fa fa-lock" title="{{$item.connector}}"></i></small>
{{/if}}
</h4>