mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-21 12:35:17 +00:00
Merge branch 'dev' of /home/macgirvin/roadhouse into dev
This commit is contained in:
commit
5827d073d1
5 changed files with 24 additions and 22 deletions
|
@ -1796,10 +1796,11 @@ class Activity {
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
else {
|
||||
$icon = $person_obj['icon'];
|
||||
}
|
||||
}
|
||||
if (! $icon) {
|
||||
if (! (isset($icon) && $icon)) {
|
||||
$icon = z_root() . '/' . get_default_profile_photo();
|
||||
}
|
||||
|
||||
|
|
|
@ -481,7 +481,7 @@ class ActivityPub {
|
|||
}
|
||||
}
|
||||
}
|
||||
if ($person_obj) {
|
||||
if (isset($person_obj)) {
|
||||
Activity::actor_store($person_obj['id'],$person_obj, $force);
|
||||
return $person_obj['id'];
|
||||
}
|
||||
|
|
|
@ -361,7 +361,7 @@ class Connedit extends Controller {
|
|||
intval(local_channel())
|
||||
);
|
||||
|
||||
if(! $orig_record) {
|
||||
if (! $orig_record) {
|
||||
notice( t('Could not access address book record.') . EOL);
|
||||
goaway(z_root() . '/connections');
|
||||
}
|
||||
|
@ -374,25 +374,21 @@ class Connedit extends Controller {
|
|||
goaway(z_root() . '/connedit/' . $contact_id);
|
||||
}
|
||||
|
||||
if($cmd === 'fetchvc') {
|
||||
if ($cmd === 'fetchvc') {
|
||||
$url = str_replace('/channel/','/profile/',$orig_record['xchan_url']) . '/vcard';
|
||||
$recurse = 0;
|
||||
$x = z_fetch_url(zid($url),false,$recurse,['session' => true]);
|
||||
if ($x['success']) {
|
||||
$h = new HTTPHeaders($x['header']);
|
||||
$fields = $h->fetch();
|
||||
if ($fields) {
|
||||
foreach ($fields as $y) {
|
||||
if (array_key_exists('content-type',$y)) {
|
||||
$type = explode(';',trim($y['content-type']));
|
||||
if ($type && $type[0] === 'text/vcard' && $x['body']) {
|
||||
$vc = Reader::read($x['body']);
|
||||
$vcard = $vc->serialize();
|
||||
if ($vcard) {
|
||||
set_abconfig(local_channel(),$orig_record['abook_xchan'],'system','vcard',$vcard);
|
||||
$this->connedit_clone($a);
|
||||
}
|
||||
}
|
||||
$fields = $h->fetcharr();
|
||||
if ($fields && array_key_exists('content-type',$fields)) {
|
||||
$type = explode(';',trim($fields['content-type']));
|
||||
if ($type && $type[0] === 'text/vcard' && $x['body']) {
|
||||
$vc = Reader::read($x['body']);
|
||||
$vcard = $vc->serialize();
|
||||
if ($vcard) {
|
||||
set_abconfig(local_channel(),$orig_record['abook_xchan'],'system','vcard',$vcard);
|
||||
$this->connedit_clone($a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -496,7 +492,7 @@ class Connedit extends Controller {
|
|||
Libsync::build_sync_packet(0, [ 'abook' => [ 'abook_xchan' => $orig_record['abook_xchan'], 'entry_deleted' => true ] ] );
|
||||
|
||||
info( t('Connection has been removed.') . EOL );
|
||||
if (x($_SESSION,'return_url')) {
|
||||
if (isset($_SESSION['return_url']) && $_SESSION['return_url']) {
|
||||
goaway(z_root() . '/' . $_SESSION['return_url']);
|
||||
}
|
||||
goaway(z_root() . '/contacts');
|
||||
|
@ -626,7 +622,6 @@ class Connedit extends Controller {
|
|||
];
|
||||
}
|
||||
|
||||
|
||||
$sections = [];
|
||||
|
||||
$sections['perms'] = [
|
||||
|
|
|
@ -51,7 +51,6 @@ class HTTPHeaders {
|
|||
}
|
||||
}
|
||||
}
|
||||
logger('fetcharr: ' . print_r($ret,true));
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -367,7 +367,14 @@ function import_remote_xchan_photo($photo, $xchan, $thing = false) {
|
|||
|
||||
if ($result['success']) {
|
||||
$type = guess_image_type($photo, $result['header']);
|
||||
|
||||
if ((! $type) || strpos($type,'image') === false) {
|
||||
@file_put_contents('cache/' . $hash, $result['body']);
|
||||
$info = getimagesize('cache/' . $hash);
|
||||
@unlink('cache/' . $hash);
|
||||
if (isset($info) && array_key_exists('mime',$info)) {
|
||||
$type = $info['mime'];
|
||||
}
|
||||
}
|
||||
if ($type) {
|
||||
$failed = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue