mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 16:35:19 +00:00
linked identities continued
This commit is contained in:
parent
642c2835a6
commit
36d1319132
3 changed files with 22 additions and 6 deletions
|
@ -176,9 +176,8 @@ class Manage extends Controller
|
|||
);
|
||||
$linkid_str = ids_to_querystr($links,'link', true);
|
||||
if ($linkid_str) {
|
||||
$linkedIdentities = q("select * from xchan where xchan_hash in (%s)",
|
||||
dbesc($linkid_str)
|
||||
);
|
||||
$linkedIdentities = q("select * from xchan where (xchan_hash in ($linkid_str) and xchan_network = 'activitypub')
|
||||
or (xchan_url in ($linkid_str) and xchan_network in ('zot6','nomad')) ");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,6 +194,18 @@ class Manage extends Controller
|
|||
$delegates = null;
|
||||
}
|
||||
|
||||
|
||||
if ($linkedIdentities) {
|
||||
for ($x = 0; $x < count($linkedIdentities); $x++) {
|
||||
$linkedIdentities[$x]['link'] = zid($linkedIdentities[$x]['xchan_url']);
|
||||
$linkedIdentities[$x]['channel_name'] = $linkedIdentities[$x]['xchan_name'];
|
||||
$linkedIdentities[$x]['delegate'] = 2;
|
||||
$linkedIdentities[$x]['collections_label'] = t('Collection');
|
||||
}
|
||||
} else {
|
||||
$linkedIdentities = null;
|
||||
}
|
||||
|
||||
return replace_macros(Theme::get_template('channels.tpl'), [
|
||||
'$header' => t('Channels'),
|
||||
'$msg_selected' => t('Current Channel'),
|
||||
|
@ -210,6 +221,7 @@ class Manage extends Controller
|
|||
'$mail_format' => t('%d new messages'),
|
||||
'$intros_format' => t('%d new introductions'),
|
||||
'$channel_usage_message' => $channel_usage_message,
|
||||
'$remote_desc' => t('Linked Identity'),
|
||||
'$delegated_desc' => t('Delegated Channel'),
|
||||
'$delegates' => $delegates,
|
||||
'$links' => $linkedIdentities,
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace Code\Web;
|
|||
use App;
|
||||
use Code\Lib\Activity;
|
||||
use Code\Lib\Channel;
|
||||
use Code\Lib\PConfig;
|
||||
use Code\Extend\Hook;
|
||||
|
||||
class WebServer
|
||||
|
@ -185,7 +186,7 @@ class WebServer
|
|||
$channel = Channel::from_username(argv(1));
|
||||
if ($channel) {
|
||||
$nomadicIds = Activity::nomadic_locations(['author_xchan' => $channel['channel_hash']]);
|
||||
$linkedIds = PConfig::Get($channel['channel_hash'],'system','identities', []);
|
||||
$linkedIds = PConfig::Get($channel['channel_id'],'system','identities', []);
|
||||
}
|
||||
App::$channel_links = [
|
||||
[
|
||||
|
|
|
@ -2,15 +2,18 @@
|
|||
<div class="float-end">
|
||||
{{if $channel.default_links}}
|
||||
{{/if}}
|
||||
{{if $channel.delegate}}
|
||||
{{if $channel.delegate == 1}}
|
||||
{{$delegated_desc}}
|
||||
{{/if}}
|
||||
{{if $channel.delegate == 2}}
|
||||
{{$remote_desc}}
|
||||
{{/if}}
|
||||
</div>
|
||||
<h3>
|
||||
{{*if $selected == $channel.channel_id}}
|
||||
<i class="fa fa-circle text-success" title="{{$msg_selected}}"></i>
|
||||
{{/if*}}
|
||||
{{if $channel.delegate}}
|
||||
{{if $channel.delegate == 1}}
|
||||
<i class="fa fa-arrow-circle-right" title="{{$delegated_desc}}"></i>
|
||||
{{/if}}
|
||||
{{if $channel.xchan_type == 2}}<i class="fa fa-tags" title="{{$channel.collections_label}}"></i> {{elseif $channel.xchan_type == 1}}<i class="fa fa-comments-o" title="{{$channel.forum_label}}"></i> {{/if}}
|
||||
|
|
Loading…
Reference in a new issue