[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', 'commented', 'created', 'edited', 'received', 'verb', 'object-type', 'postopts', 'plink',
'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language', 'wall', 'private', 'starred', 'origin', 'parent-origin', 'title', 'body', 'language',
'content-warning', 'location', 'coord', 'app', 'rendered-hash', 'rendered-html', 'object', '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', 'author-id', 'author-link', 'author-name', 'author-avatar', 'author-network',
'owner-id', 'owner-link', 'owner-name', 'owner-avatar', 'owner-network', 'owner-contact-type', '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', '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') ? DI::l10n()->t('Private Message')
: false); : false);
$connector = !$item['global'] ? DI::l10n()->t('Connector Message') : false;
$shareable = in_array($conv->getProfileOwner(), [0, local_user()]) && $item['private'] != Item::PRIVATE; $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]); $announceable = $shareable && in_array($item['network'], [Protocol::ACTIVITYPUB, Protocol::DFRN, Protocol::DIASPORA, Protocol::TWITTER]);
@ -469,6 +471,7 @@ class Post
'app' => $item['app'], 'app' => $item['app'],
'created' => $ago, 'created' => $ago,
'lock' => $lock, 'lock' => $lock,
'connector' => $connector,
'location_html' => $location_html, 'location_html' => $location_html,
'indent' => $indent, 'indent' => $indent,
'shiny' => $shiny, 'shiny' => $shiny,

View File

@ -63,8 +63,9 @@
<span class="navicon lock fakelink" onClick="lockview(event, 'item', {{$item.id}});" title="{{$item.lock}}"> <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> &nbsp;<small><i class="fa fa-lock" aria-hidden="true"></i></small>
</span> </span>
{{elseif $item.connector}}
<span class="fa fa-lock" title="{{$item.connector}}"></span>
{{/if}} {{/if}}
<div class="additional-info text-muted"> <div class="additional-info text-muted">
<div id="wall-item-ago-{{$item.id}}" class="wall-item-ago"> <div id="wall-item-ago-{{$item.id}}" class="wall-item-ago">
<small> <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}} {{if $item.star}}
<span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span> <span class="icon s22 star {{$item.isstarred}}" id="starred-{{$item.id}}" title="{{$item.star.starred}}">{{$item.star.starred}}</span>
{{/if}} {{/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> </div>
{{* /TODO => Unknown block *}} {{* /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"> <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> &nbsp;<small><i class="fa fa-lock" aria-hidden="true"></i></small>
</span> </span>
{{elseif $item.connector}}
<small><i class="fa fa-lock" title="{{$item.connector}}"></i></small>
{{/if}} {{/if}}
</h4> </h4>