diff --git a/Code/Module/Item.php b/Code/Module/Item.php index 0f88378cb..cb55f36a9 100644 --- a/Code/Module/Item.php +++ b/Code/Module/Item.php @@ -1393,20 +1393,7 @@ class Item extends Controller if (! (isset($replyto) && $replyto)) { - if ($owner_hash && strpos($owner_hash,'http') === 0) { - $replyto = $owner_hash; - } - else { - $tmp = $owner_hash ? $owner_hash : $owner_xchan['xchan_hash']; - if ($tmp) { - $r = q("select * from xchan where xchan_hash = '%s'", - dbesc($tmp) - ); - if ($r) { - $replyto = Activity::encode_person($r[0],false); - } - } - } + $replyto = Activity::encode_person($owner_xchan, false); } if ($private && !$parent) { diff --git a/doc/en/addons.mc b/doc/en/addons.mc index 644ac6e8c..ed7b075b4 100644 --- a/doc/en/addons.mc +++ b/doc/en/addons.mc @@ -47,9 +47,9 @@ Authenticate an account against an enterprise LDAP directory such as Windows Act Logfile Rotator -### Nodeinfo Statistics +### Nodeinfo -Generates some statistics for the-federation.info and other nodeinfo based services +Provides site discovery using the Nodeinfo protocol. This is voluntary, and permits listing this site in online fediverse directories. ### Not Safe For Work diff --git a/include/photos.php b/include/photos.php index f945292ac..357a8f4b4 100644 --- a/include/photos.php +++ b/include/photos.php @@ -427,7 +427,7 @@ function photo_upload($channel, $observer, $args) . $tag . z_root() . "/photo/{$photo_hash}-{$scale}." . $ph->getExt() . '[/zmg]' . '[/zrl]'; - $attribution = (($visitor) ? $visitor['xchan_url'] : $channel['xchan_url']); + $attribution = (Activity::encode_person(($visitor) ? $visitor : $channel, false); // Create item object $object = [ @@ -909,60 +909,6 @@ function photos_album_get_db_idstr_admin($channel_id, $album) } - -/** - * @brief Creates a new photo item. - * - * @param array $channel - * @param string $creator_hash - * @param array $photo - * @param bool $visible (optional) default false - * @return int item_id - */ -function photos_create_item($channel, $creator_hash, $photo, $visible = false) -{ - - // Create item container - - $item_hidden = (($visible) ? 0 : 1 ); - - $uuid = new_uuid(); - $mid = z_root() . '/item/' . $uuid; - - $arr = []; - - $arr['aid'] = $channel['channel_account_id']; - $arr['uid'] = $channel['channel_id']; - $arr['uuid'] = $uuid; - $arr['mid'] = $mid; - $arr['parent_mid'] = $mid; - $arr['item_wall'] = 1; - $arr['item_origin'] = 1; - $arr['item_thread_top'] = 1; - $arr['item_hidden'] = $item_hidden; - $arr['resource_type'] = 'photo'; - $arr['resource_id'] = $photo['resource_id']; - $arr['owner_xchan'] = $channel['channel_hash']; - $arr['author_xchan'] = $creator_hash; - - $arr['allow_cid'] = $photo['allow_cid']; - $arr['allow_gid'] = $photo['allow_gid']; - $arr['deny_cid'] = $photo['deny_cid']; - $arr['deny_gid'] = $photo['deny_gid']; - - $arr['plink'] = z_root() . '/channel/' . $channel['channel_address'] . '/?f=&mid=' . urlencode($arr['mid']); - - $arr['body'] = '[zrl=' . z_root() . '/photos/' . $channel['channel_address'] . '/image/' . $photo['resource_id'] . ']' - . '[zmg]' . z_root() . '/photo/' . $photo['resource_id'] . '-' . $photo['imgscale'] . '[/zmg]' - . '[/zrl]'; - - $result = item_store($arr); - $item_id = $result['item_id']; - - return $item_id; -} - - function getGps($exifCoord, $hemi) { diff --git a/version.php b/version.php index 4f0a7cbac..e1c106666 100644 --- a/version.php +++ b/version.php @@ -1,2 +1,2 @@