mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:35:12 +00:00
connect perms
This commit is contained in:
parent
4ed37e3b33
commit
ed4aa90338
7 changed files with 36 additions and 6 deletions
|
@ -628,7 +628,10 @@ class Activity {
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($activitypub) {
|
if($activitypub) {
|
||||||
|
|
||||||
$c = channelx_by_hash($p['xchan_hash']);
|
$c = channelx_by_hash($p['xchan_hash']);
|
||||||
|
|
||||||
if($c) {
|
if($c) {
|
||||||
|
@ -655,6 +658,17 @@ class Activity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
|
||||||
|
$ret['inbox'] = z_root() . '/nullbox';
|
||||||
|
$ret['outbox'] = z_root() . '/nullbox';
|
||||||
|
$ret['publicKey'] = [
|
||||||
|
'id' => $p['xchan_url'] . '/public_key_pem',
|
||||||
|
'owner' => $p['xchan_url'],
|
||||||
|
'publicKeyPem' => $p['xchan_pubkey']
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
$arr = [ 'xchan' => $p, 'encoded' => $ret, 'activitypub' => $activitypub ];
|
$arr = [ 'xchan' => $p, 'encoded' => $ret, 'activitypub' => $activitypub ];
|
||||||
call_hooks('encode_person', $arr);
|
call_hooks('encode_person', $arr);
|
||||||
|
|
|
@ -103,7 +103,7 @@ class Channel extends Controller {
|
||||||
$x = array_merge(['@context' => [
|
$x = array_merge(['@context' => [
|
||||||
ACTIVITYSTREAMS_JSONLD_REV,
|
ACTIVITYSTREAMS_JSONLD_REV,
|
||||||
'https://w3id.org/security/v1'
|
'https://w3id.org/security/v1'
|
||||||
]], Activity::encode_person($channel));
|
]], Activity::encode_person($channel,true));
|
||||||
|
|
||||||
json_return_and_die($x,'application/activity+json');
|
json_return_and_die($x,'application/activity+json');
|
||||||
|
|
||||||
|
|
|
@ -160,9 +160,9 @@ class Connedit extends \Zotlabs\Web\Controller {
|
||||||
// adjust permissions as desired.
|
// adjust permissions as desired.
|
||||||
|
|
||||||
$p = \Zotlabs\Access\Permissions::connect_perms(local_channel());
|
$p = \Zotlabs\Access\Permissions::connect_perms(local_channel());
|
||||||
$my_perms = $p['perms'];
|
$my_perms = \Zotlabs\Acess\Permissions($p['perms']);
|
||||||
if($my_perms) {
|
if($my_perms) {
|
||||||
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'system','my_perms',implode(',',$my_perms));
|
set_abconfig($channel['channel_id'],$orig_record[0]['abook_xchan'],'system','my_perms',$my_perms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,7 @@ logger('gis: ' . print_r($gis,true));
|
||||||
$arr['item_thread_top'] = 1;
|
$arr['item_thread_top'] = 1;
|
||||||
$arr['item_origin'] = 1;
|
$arr['item_origin'] = 1;
|
||||||
$arr['item_wall'] = 1;
|
$arr['item_wall'] = 1;
|
||||||
|
$arr['mid'] = item_message_id();
|
||||||
$arr['obj_type'] = ACTIVITY_OBJ_PHOTO;
|
$arr['obj_type'] = ACTIVITY_OBJ_PHOTO;
|
||||||
$arr['verb'] = ACTIVITY_UPDATE;
|
$arr['verb'] = ACTIVITY_UPDATE;
|
||||||
|
|
||||||
|
@ -277,7 +278,7 @@ logger('gis: ' . print_r($gis,true));
|
||||||
'type' => ACTIVITY_OBJ_PHOTO,
|
'type' => ACTIVITY_OBJ_PHOTO,
|
||||||
'published' => datetime_convert('UTC','UTC',$photo['created'],ATOM_TIME),
|
'published' => datetime_convert('UTC','UTC',$photo['created'],ATOM_TIME),
|
||||||
'updated' => datetime_convert('UTC','UTC',$photo['edited'],ATOM_TIME),
|
'updated' => datetime_convert('UTC','UTC',$photo['edited'],ATOM_TIME),
|
||||||
'id' => z_root() . '/photo/' . $photo['resource_id'] . '-7',
|
'id' => $arr['mid'],
|
||||||
'url' => [ 'type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7' ],
|
'url' => [ 'type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/' . $photo['resource_id'] . '-7' ],
|
||||||
'source' => [ 'content' => $arr['body'], 'mediaType' => 'text/bbcode' ],
|
'source' => [ 'content' => $arr['body'], 'mediaType' => 'text/bbcode' ],
|
||||||
'content' => bbcode($arr['body']),
|
'content' => bbcode($arr['body']),
|
||||||
|
|
14
Zotlabs/Module/Nullbox.php
Normal file
14
Zotlabs/Module/Nullbox.php
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Zotlabs\Module;
|
||||||
|
|
||||||
|
use Zotlabs\Web\Controller;
|
||||||
|
|
||||||
|
class Nullbox extends Controller {
|
||||||
|
|
||||||
|
function init() {
|
||||||
|
http_status_exit(404,'Permission Denied');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1002,7 +1002,7 @@ function thread_author_menu($item, $mode = '') {
|
||||||
if($profile_link) {
|
if($profile_link) {
|
||||||
$menu[] = [
|
$menu[] = [
|
||||||
'menu' => 'view_profile',
|
'menu' => 'view_profile',
|
||||||
'title' => t('View Profile'),
|
'title' => t('Visit'),
|
||||||
'icon' => 'fw',
|
'icon' => 'fw',
|
||||||
'action' => '',
|
'action' => '',
|
||||||
'href' => $profile_link
|
'href' => $profile_link
|
||||||
|
|
|
@ -4480,6 +4480,7 @@ function send_profile_photo_activity($channel,$photo,$profile) {
|
||||||
$arr['item_wall'] = 1;
|
$arr['item_wall'] = 1;
|
||||||
$arr['obj_type'] = ACTIVITY_OBJ_PHOTO;
|
$arr['obj_type'] = ACTIVITY_OBJ_PHOTO;
|
||||||
$arr['verb'] = ACTIVITY_UPDATE;
|
$arr['verb'] = ACTIVITY_UPDATE;
|
||||||
|
$arr['mid'] = item_message_id();
|
||||||
|
|
||||||
if(stripos($profile['gender'],t('female')) !== false)
|
if(stripos($profile['gender'],t('female')) !== false)
|
||||||
$t = t('%1$s updated her %2$s');
|
$t = t('%1$s updated her %2$s');
|
||||||
|
@ -4499,7 +4500,7 @@ function send_profile_photo_activity($channel,$photo,$profile) {
|
||||||
'type' => ACTIVITY_OBJ_PHOTO,
|
'type' => ACTIVITY_OBJ_PHOTO,
|
||||||
'published' => datetime_convert('UTC','UTC',$photo['created'],ATOM_TIME),
|
'published' => datetime_convert('UTC','UTC',$photo['created'],ATOM_TIME),
|
||||||
'updated' => datetime_convert('UTC','UTC',$photo['edited'],ATOM_TIME),
|
'updated' => datetime_convert('UTC','UTC',$photo['edited'],ATOM_TIME),
|
||||||
'id' => z_root() . '/photo/profile/l/' . $channel['channel_id'],
|
'id' => $arr['mid'],
|
||||||
'url' => [ 'type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/profile/l/' . $channel['channel_id'] ],
|
'url' => [ 'type' => 'Link', 'mediaType' => $photo['mimetype'], 'href' => z_root() . '/photo/profile/l/' . $channel['channel_id'] ],
|
||||||
'source' => [ 'content' => $arr['body'], 'mediaType' => 'text/bbcode' ],
|
'source' => [ 'content' => $arr['body'], 'mediaType' => 'text/bbcode' ],
|
||||||
'content' => bbcode($arr['body']),
|
'content' => bbcode($arr['body']),
|
||||||
|
|
Loading…
Reference in a new issue