mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-19 01:15:15 +00:00
Merge branch 'dev' of codeberg.org:streams/streams into dev
This commit is contained in:
commit
181728e884
2 changed files with 19 additions and 10 deletions
|
@ -4874,6 +4874,11 @@ function fix_attached_permissions($uid,$body,$str_contact_allow,$str_group_allow
|
|||
intval($uid)
|
||||
);
|
||||
}
|
||||
$sync = attach_export_data($channel, $file);
|
||||
|
||||
if ($sync) {
|
||||
Libsync::build_sync_packet($channel['channel_id'], ['file' => [$sync]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2151,11 +2151,13 @@ class Activity
|
|||
|
||||
self::actor_store($person_obj['id'], $person_obj);
|
||||
|
||||
$actorId = new ActorId($person_obj['id']);
|
||||
|
||||
// Find any existing abook record
|
||||
|
||||
$r = q(
|
||||
"select * from abook left join xchan on abook_xchan = xchan_hash where abook_xchan = '%s' and abook_channel = %d limit 1",
|
||||
dbesc($person_obj['id']),
|
||||
dbesc($actorId->getId()),
|
||||
intval($channel['channel_id'])
|
||||
);
|
||||
if ($r) {
|
||||
|
@ -2164,8 +2166,10 @@ class Activity
|
|||
}
|
||||
|
||||
$x = PermissionRoles::role_perms('social');
|
||||
$theirPerms = $x['perms_connect'];
|
||||
|
||||
logger('their_perms: ' . print_r($theirPerms, true));
|
||||
if (!$theirPerms) {
|
||||
$theirPerms = $x['perms_connect'];
|
||||
}
|
||||
// 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)) {
|
||||
$theirPerms[] = 'tag_deliver';
|
||||
|
@ -2187,11 +2191,11 @@ class Activity
|
|||
// We've already approved them or followed them first
|
||||
// Send an Accept back to them
|
||||
|
||||
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'], $actorId->getId(), 'activitypub', 'their_follow_id', $their_follow_id);
|
||||
set_abconfig($channel['channel_id'], $actorId->getId(), 'activitypub', 'their_follow_type', $act->type);
|
||||
// In case they unfollowed us and followed again, reset their permissions to show that we're connected again.
|
||||
if ($theirPerms) {
|
||||
AbConfig::Set($channel['channel_id'], $person_obj['id'], 'system', 'their_perms', implode(',', $theirPerms));
|
||||
AbConfig::Set($channel['channel_id'], $actorId->getId(), 'system', 'their_perms', implode(',', $theirPerms));
|
||||
}
|
||||
Run::Summon(['Notifier', 'permissions_accept', $contact['abook_id']]);
|
||||
return;
|
||||
|
@ -2237,18 +2241,18 @@ class Activity
|
|||
|
||||
// From here on out we assume a Follow activity from somebody we have no existing relationship with
|
||||
|
||||
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'], $actorId->getId(), 'activitypub', 'their_follow_id', $their_follow_id);
|
||||
set_abconfig($channel['channel_id'], $actorId->getId(), 'activitypub', 'their_follow_type', $act->type);
|
||||
|
||||
// The xchan should have been created by actor_store() above
|
||||
|
||||
$r = q(
|
||||
"select * from xchan where xchan_hash = '%s' and xchan_network = 'activitypub' limit 1",
|
||||
dbesc($person_obj['id'])
|
||||
dbesc($actorId->getId())
|
||||
);
|
||||
|
||||
if (!$r) {
|
||||
logger('xchan not found for ' . $person_obj['id']);
|
||||
logger('xchan not found for ' . $actorId->getId());
|
||||
return;
|
||||
}
|
||||
$ret = $r[0];
|
||||
|
|
Loading…
Reference in a new issue