diff options
author | nobody <nobody@zotlabs.com> | 2021-04-16 04:42:45 -0700 |
---|---|---|
committer | nobody <nobody@zotlabs.com> | 2021-04-16 04:42:45 -0700 |
commit | a96345401f47be71a6eef531e204c0e25b792a16 (patch) | |
tree | 4afde386815934f9f395353b0d1d38cfd7f2592c /Zotlabs/Lib | |
parent | 9359fc065c72243bd85f0fc3db842976f07183cc (diff) | |
parent | 7ccd7b439f5a029384ecb28911a0df6f6d658231 (diff) | |
download | volse-hubzilla-a96345401f47be71a6eef531e204c0e25b792a16.tar.gz volse-hubzilla-a96345401f47be71a6eef531e204c0e25b792a16.tar.bz2 volse-hubzilla-a96345401f47be71a6eef531e204c0e25b792a16.zip |
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r-- | Zotlabs/Lib/Activity.php | 41 | ||||
-rw-r--r-- | Zotlabs/Lib/Enotify.php | 8 |
2 files changed, 20 insertions, 29 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 882bf4a1c..82e74fc83 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -1094,18 +1094,7 @@ class Activity { 'height' => 300, 'width' => 300, ]; - $ret['url'] = [ - [ - 'type' => 'Link', - 'mediaType' => 'text/html', - 'href' => $p['xchan_url'] - ], - [ - 'type' => 'Link', - 'mediaType' => 'text/x-zot+json', - 'href' => $p['xchan_url'] - ] - ]; + $ret['url'] = $p['xchan_url']; $ret['publicKey'] = [ 'id' => $p['xchan_url'], @@ -1334,12 +1323,12 @@ class Activity { * */ - $person_obj = $act->actor; - - if ($act->type === 'Follow') { + if (in_array($act->type, [ 'Follow', 'Invite', 'Join'])) { $their_follow_id = $act->id; } + $person_obj = (($act->type == 'Invite') ? $act->obj : $act->actor); + if (is_array($person_obj)) { // store their xchan and hubloc @@ -1357,9 +1346,8 @@ class Activity { } } - $x = PermissionRoles::role_perms('social'); - $p = Permissions::FilledPerms($x['perms_connect']); - $their_perms = Permissions::serialise($p); + $x = \Zotlabs\Access\PermissionRoles::role_perms('social'); + $their_perms = \Zotlabs\Access\Permissions::FilledPerms($x['perms_connect']); if ($contact && $contact['abook_id']) { @@ -1368,6 +1356,8 @@ class Activity { switch ($act->type) { case 'Follow': + case 'Invite': + case 'Join': // A second Follow request, but we haven't approved the first one @@ -1433,8 +1423,8 @@ class Activity { } $ret = $r[0]; - $p = Permissions::connect_perms($channel['channel_id']); - $my_perms = Permissions::serialise($p['perms']); + $p = \Zotlabs\Access\Permissions::connect_perms($channel['channel_id']); + $my_perms = $p['perms']; $automatic = $p['automatic']; $closeness = get_pconfig($channel['channel_id'], 'system', 'new_abook_closeness', 80); @@ -1454,12 +1444,13 @@ class Activity { ] ); - if ($my_perms) - set_abconfig($channel['channel_id'], $ret['xchan_hash'], 'system', 'my_perms', $my_perms); - - if ($their_perms) - set_abconfig($channel['channel_id'], $ret['xchan_hash'], 'system', 'their_perms', $their_perms); + if($my_perms) + foreach($my_perms as $k => $v) + set_abconfig($channel['channel_id'],$ret['xchan_hash'],'my_perms',$k,$v); + if($their_perms) + foreach($their_perms as $k => $v) + set_abconfig($channel['channel_id'],$ret['xchan_hash'],'their_perms',$k,$v); if ($r) { logger("New ActivityPub follower for {$channel['channel_name']}"); diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index d2a0f0abc..ac782c740 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -978,12 +978,12 @@ class Enotify { $x = [ 'notify_link' => z_root() . '/admin/accounts', - 'name' => $rr['account_email'], - //'addr' => $rr['account_email'], + 'name' => $rr['reg_did2'], + //'addr' => '', 'photo' => z_root() . '/' . get_default_profile_photo(48), - 'when' => datetime_convert('UTC', date_default_timezone_get(),$rr['account_created']), + 'when' => datetime_convert('UTC', date_default_timezone_get(),$rr['reg_created']), 'hclass' => ('notify-unseen'), - 'message' => t('requires approval') + 'message' => t('verified') ]; return $x; |