mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 21:35:13 +00:00
Merge branch 'nomadic' of codeberg.org:streams/streams into nomadic
This commit is contained in:
commit
8ff343da08
11 changed files with 2191 additions and 2137 deletions
|
@ -541,7 +541,6 @@ function check_deliver_permissions($item, $arr, $includeMentions = false)
|
||||||
if (in_array($recipient, $theyAccept)) {
|
if (in_array($recipient, $theyAccept)) {
|
||||||
$accepting = true;
|
$accepting = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!in_array($recipient,$willNotSend)) {
|
if (!in_array($recipient,$willNotSend)) {
|
||||||
$deliverable = true;
|
$deliverable = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -316,6 +316,18 @@ class Permissions
|
||||||
return ( [ 'perms' => $my_perms, 'automatic' => $automatic ] );
|
return ( [ 'perms' => $my_perms, 'automatic' => $automatic ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static public function perm_remove($arr, $perm)
|
||||||
|
{
|
||||||
|
$retval = [];
|
||||||
|
if ($arr) {
|
||||||
|
foreach ($arr as $element) {
|
||||||
|
if ($element !== $perm) {
|
||||||
|
$retval[] = $element;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $retval;
|
||||||
|
}
|
||||||
|
|
||||||
public static function serialise($p)
|
public static function serialise($p)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2165,17 +2165,13 @@ class Activity
|
||||||
}
|
}
|
||||||
|
|
||||||
$x = PermissionRoles::role_perms('social');
|
$x = PermissionRoles::role_perms('social');
|
||||||
$p = Permissions::FilledPerms($x['perms_connect']);
|
$theirPerms = $x['perms_connect'];
|
||||||
|
|
||||||
// add tag_deliver permissions to remote groups
|
// add tag_deliver permissions to remote groups (deprecated, use post_wall instead)
|
||||||
|
if (is_array($person_obj) && $person_obj['type'] === 'Group' && !in_array('tag_deliver', $theirPerms)) {
|
||||||
if (is_array($person_obj) && $person_obj['type'] === 'Group') {
|
$theirPerms[] = 'tag_deliver';
|
||||||
$p['tag_deliver'] = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$their_perms = Permissions::serialise($p);
|
|
||||||
|
|
||||||
|
|
||||||
if ($contact && $contact['abook_id']) {
|
if ($contact && $contact['abook_id']) {
|
||||||
// A relationship of some form already exists on this site.
|
// A relationship of some form already exists on this site.
|
||||||
|
|
||||||
|
@ -2195,16 +2191,21 @@ class Activity
|
||||||
set_abconfig($channel['channel_id'], $person_obj['id'], 'activitypub', 'their_follow_id', $their_follow_id);
|
set_abconfig($channel['channel_id'], $person_obj['id'], 'activitypub', 'their_follow_id', $their_follow_id);
|
||||||
set_abconfig($channel['channel_id'], $person_obj['id'], 'activitypub', 'their_follow_type', $act->type);
|
set_abconfig($channel['channel_id'], $person_obj['id'], 'activitypub', 'their_follow_type', $act->type);
|
||||||
// In case they unfollowed us and followed again, reset their permissions to show that we're connected again.
|
// In case they unfollowed us and followed again, reset their permissions to show that we're connected again.
|
||||||
if ($their_perms) {
|
if ($theirPerms) {
|
||||||
AbConfig::Set($channel['channel_id'], $person_obj['id'], 'system', 'their_perms', $their_perms);
|
AbConfig::Set($channel['channel_id'], $person_obj['id'], 'system', 'their_perms', implode(',', $theirPerms));
|
||||||
}
|
}
|
||||||
Run::Summon(['Notifier', 'permissions_accept', $contact['abook_id']]);
|
Run::Summon(['Notifier', 'permissions_accept', $contact['abook_id']]);
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case 'Accept':
|
case 'Accept':
|
||||||
// They accepted our Follow request - set default permissions
|
// They accepted our Follow request - set default permissions, but if this is a one-sided new
|
||||||
|
// connection, as indicated by their_perms not yet existing, leave out send_stream in their_perms
|
||||||
set_abconfig($channel['channel_id'], $contact['abook_xchan'], 'system', 'their_perms', $their_perms);
|
// - because they aren't following us
|
||||||
|
$findPerms = AbConfig::Get($channel['channel_id'], $contact['abook_xchan'], 'system', 'their_perms');
|
||||||
|
if (!$findPerms) {
|
||||||
|
$theirPerms = Permissions::perm_remove($theirPerms, 'send_stream');
|
||||||
|
}
|
||||||
|
AbConfig::Set($channel['channel_id'], $contact['abook_xchan'], 'system', 'their_perms', implode(',', $theirPerms));
|
||||||
|
|
||||||
$abook_instance = $contact['abook_instance'];
|
$abook_instance = $contact['abook_instance'];
|
||||||
|
|
||||||
|
@ -2292,8 +2293,8 @@ class Activity
|
||||||
AbConfig::Set($channel['channel_id'], $ret['xchan_hash'], 'system', 'my_perms', $my_perms);
|
AbConfig::Set($channel['channel_id'], $ret['xchan_hash'], 'system', 'my_perms', $my_perms);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($their_perms) {
|
if ($theirPerms) {
|
||||||
AbConfig::Set($channel['channel_id'], $ret['xchan_hash'], 'system', 'their_perms', $their_perms);
|
AbConfig::Set($channel['channel_id'], $ret['xchan_hash'], 'system', 'their_perms', implode(',', $theirPerms));
|
||||||
}
|
}
|
||||||
|
|
||||||
// not widely used: save an intro message if it's here.
|
// not widely used: save an intro message if it's here.
|
||||||
|
|
|
@ -345,7 +345,7 @@ class Connections extends Controller
|
||||||
];
|
];
|
||||||
|
|
||||||
$oneway = false;
|
$oneway = false;
|
||||||
if (!their_perms_contains(local_channel(), $rr['xchan_hash'], 'post_comments')) {
|
if (!their_perms_contains(local_channel(), $rr['xchan_hash'], 'send_stream')) {
|
||||||
$oneway = true;
|
$oneway = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,6 +395,8 @@ class Connections extends Controller
|
||||||
'recent_label' => t('Recent activity'),
|
'recent_label' => t('Recent activity'),
|
||||||
'recentlink' => z_root() . '/stream/?cid=' . intval($rr['abook_id']),
|
'recentlink' => z_root() . '/stream/?cid=' . intval($rr['abook_id']),
|
||||||
'oneway' => $oneway,
|
'oneway' => $oneway,
|
||||||
|
'oneway_desc' => t('Is not following your posts'),
|
||||||
|
'group_desc' => t('Is only following group posts'),
|
||||||
'allow_delete' => ($rr['abook_pending'] || get_pconfig(local_channel(), 'system', 'connections_quick_delete')),
|
'allow_delete' => ($rr['abook_pending'] || get_pconfig(local_channel(), 'system', 'connections_quick_delete')),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,11 +69,14 @@ class Viewconnections extends Controller
|
||||||
'thumb' => $rr['xchan_photo_m'],
|
'thumb' => $rr['xchan_photo_m'],
|
||||||
'name' => substr($rr['xchan_name'], 0, 20),
|
'name' => substr($rr['xchan_name'], 0, 20),
|
||||||
'username' => $rr['xchan_addr'],
|
'username' => $rr['xchan_addr'],
|
||||||
|
'channel_type' => $rr['xchan_type'],
|
||||||
'link' => $url,
|
'link' => $url,
|
||||||
'sparkle' => '',
|
'sparkle' => '',
|
||||||
'itemurl' => $rr['url'],
|
'itemurl' => $rr['url'],
|
||||||
'network' => '',
|
'network' => '',
|
||||||
'oneway' => $oneway
|
'oneway' => $oneway,
|
||||||
|
'oneway_desc' => t('Is not following back'),
|
||||||
|
'group_desc' => t('Is only following group posts')
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ function po2php_run($argc, $argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($infile as $l) {
|
foreach ($infile as $l) {
|
||||||
$l = str_replace(array('$projectname','$Projectname'), array('\$projectname','\$Projectname'), $l);
|
$l = str_replace(array('$projectname','$Projectname', '$Sitename', '$sitename'), array('\$projectname','\$Projectname', '\$Sitename', '\$sitename'), $l);
|
||||||
$len = strlen($l);
|
$len = strlen($l);
|
||||||
if ($l[0] == '#') {
|
if ($l[0] == '#') {
|
||||||
$l = '';
|
$l = '';
|
||||||
|
|
Binary file not shown.
3346
view/fr/messages.po
3346
view/fr/messages.po
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -40,7 +40,11 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<!--/a -->
|
<!--/a -->
|
||||||
{{if $contact.oneway}}
|
{{if $contact.oneway}}
|
||||||
<i class="fa fa-fw fa-minus-circle oneway-overlay text-danger"></i>
|
{{if $contact.channel_type == 1}}
|
||||||
|
<i class="fa fa-fw fa-plus-circle oneway-overlay text-danger" title="{{$contact.group_desc}}"></i>
|
||||||
|
{{else}}
|
||||||
|
<i class="fa fa-fw fa-minus-circle oneway-overlay text-danger" title="{{$contact.oneway_desc}}"></i>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-info">
|
<div class="contact-info">
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" >
|
<div class="contact-entry-wrapper" id="contact-entry-wrapper-{{$contact.id}}" >
|
||||||
<div class="contact-entry-photo-wrapper" >
|
<div class="contact-entry-photo-wrapper" >
|
||||||
<a href="{{$contact.link}}" title="{{$contact.img_hover}}" ><img class="contact-block-img" src="{{$contact.thumb}}" alt="{{$contact.name}}" /></a>
|
<a href="{{$contact.link}}" title="{{$contact.img_hover}}" ><img class="contact-block-img" src="{{$contact.thumb}}" alt="{{$contact.name}}" /></a>
|
||||||
{{if $contact.oneway}}
|
{{if $contact.oneway}}
|
||||||
<i class="fa fa-fw fa-minus-circle oneway-overlay text-danger"></i>
|
{{if $contact.channel_type == 1}}
|
||||||
|
<i class="fa fa-fw fa-plus-circle oneway-overlay text-danger" title="{{$contact.group_desc}}"></i>
|
||||||
|
{{else}}
|
||||||
|
<i class="fa fa-fw fa-minus-circle oneway-overlay text-danger" title="{{$contact.oneway_desc}}"></i>
|
||||||
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
<div class="contact-entry-photo-end" ></div>
|
<div class="contact-entry-photo-end" ></div>
|
||||||
|
|
Loading…
Reference in a new issue