diff --git a/CHANGELOG.md b/CHANGELOG.md index 083654d2e..958bd8943 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,6 +86,8 @@ - Update ApiV1Controller, fix mute/block entities ([364adb43](https://github.com/pixelfed/pixelfed/commit/364adb43)) - Update atom feed, remove invalid entities ([e362ef9e](https://github.com/pixelfed/pixelfed/commit/e362ef9e)) - Update StatusObserver, handle events after all transactions are committed ([805a014e](https://github.com/pixelfed/pixelfed/commit/805a014e)) +- Update ApiV1Controller, add collection_ids parameter to /api/v1/statuses endpoint ([7ae21fc3](https://github.com/pixelfed/pixelfed/commit/7ae21fc3)) +- Update ApiV1Controller, add comments_disabled param to /api/v1/statuses endpoint ([95b58610](https://github.com/pixelfed/pixelfed/commit/95b58610)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.3 (2022-05-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.2...v0.11.3) diff --git a/app/Http/Controllers/Api/ApiV1Controller.php b/app/Http/Controllers/Api/ApiV1Controller.php index 42b5e6121..9411cc0a9 100644 --- a/app/Http/Controllers/Api/ApiV1Controller.php +++ b/app/Http/Controllers/Api/ApiV1Controller.php @@ -12,6 +12,8 @@ use Auth, Cache, DB, URL; use App\{ Avatar, Bookmark, + Collection, + CollectionItem, DirectMessage, Follower, FollowRequest, @@ -59,6 +61,7 @@ use App\Jobs\VideoPipeline\{ use App\Services\{ AccountService, + CollectionService, FollowerService, InstanceService, LikeService, @@ -2481,7 +2484,9 @@ class ApiV1Controller extends Controller 'sensitive' => 'nullable', 'visibility' => 'string|in:private,unlisted,public', 'spoiler_text' => 'sometimes|max:140', - 'place_id' => 'sometimes|integer|min:1|max:128769' + 'place_id' => 'sometimes|integer|min:1|max:128769', + 'collection_ids' => 'sometimes|array|max:3', + 'comments_disabled' => 'sometimes|boolean', ]); if(config('costar.enabled') == true) { @@ -2536,6 +2541,9 @@ class ApiV1Controller extends Controller if($in_reply_to_id) { $parent = Status::findOrFail($in_reply_to_id); + if($parent->comments_disabled) { + return $this->json("Comments have been disabled on this post", 422); + } $blocks = UserFilterService::blocks($parent->profile_id); abort_if(in_array($profile->id, $blocks), 422, 'Cannot reply to this post at this time.'); @@ -2597,6 +2605,10 @@ class ApiV1Controller extends Controller abort(400, 'Invalid media ids'); } + if($request->has('comments_disabled') && $request->input('comments_disabled')) { + $status->comments_disabled = true; + } + $status->scope = $visibility; $status->visibility = $visibility; $status->type = StatusController::mimeTypeCheck($mimes); @@ -2618,6 +2630,27 @@ class ApiV1Controller extends Controller Cache::forget('profile:embed:' . $status->profile_id); Cache::forget($limitKey); + if($request->has('collection_ids') && $ids) { + $collections = Collection::whereProfileId($user->profile_id) + ->find($request->input('collection_ids')) + ->each(function($collection) use($status) { + $count = $collection->items()->count(); + $item = CollectionItem::firstOrCreate([ + 'collection_id' => $collection->id, + 'object_type' => 'App\Status', + 'object_id' => $status->id + ],[ + 'order' => $count, + ]); + + CollectionService::addItem( + $collection->id, + $status->id, + $count + ); + }); + } + $res = StatusService::getMastodon($status->id, false); $res['favourited'] = false; $res['language'] = 'en'; diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index 4e6272f04..e168e4ff7 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -17,6 +17,7 @@ use App\Transformer\Api\{ }; use League\Fractal\Serializer\ArraySerializer; use League\Fractal\Pagination\IlluminatePaginatorAdapter; +use App\Services\AccountService; use App\Services\CollectionService; use App\Services\FollowerService; use App\Services\StatusService; @@ -222,32 +223,33 @@ class CollectionController extends Controller $follows = false; $visibility = ['public']; - $profile = Profile::whereNull('status') - ->whereNull('domain') - ->findOrFail($id); - - if($pid) { - $follows = FollowerService::follows($pid, $profile->id); + $profile = AccountService::get($id, true); + if(!$profile || !isset($profile['id'])) { + return response()->json([], 404); } - if($profile->is_private) { + if($pid) { + $follows = FollowerService::follows($pid, $profile['id']); + } + + if($profile['locked']) { abort_if(!$pid, 404); if(!$user->is_admin) { - abort_if($profile->id != $pid && $follows == false, 404); + abort_if($profile['id'] != $pid && $follows == false, 404); } } - $owner = $pid ? $pid == $profile->id : false; + $owner = $pid ? $pid == $profile['id'] : false; if($follows) { $visibility = ['public', 'private']; } - if($pid && $pid == $profile->id) { + if($pid && $pid == $profile['id']) { $visibility = ['public', 'private', 'draft']; } - return Collection::whereProfileId($profile->id) + return Collection::whereProfileId($profile['id']) ->whereIn('visibility', $visibility) ->when(!$owner, function($q, $owner) { return $q->whereNotNull('published_at'); diff --git a/app/Http/Controllers/MobileController.php b/app/Http/Controllers/MobileController.php new file mode 100644 index 000000000..3ca206bbc --- /dev/null +++ b/app/Http/Controllers/MobileController.php @@ -0,0 +1,29 @@ +addDays(120), function() { + $slug = '/site/terms'; + return Page::whereSlug($slug)->whereActive(true)->first(); + }); + return View::make('mobile.terms')->with(compact('page'))->render(); + } + + public function privacy(Request $request) + { + $page = Cache::remember('site:privacy', now()->addDays(120), function() { + $slug = '/site/privacy'; + return Page::whereSlug($slug)->whereActive(true)->first(); + }); + return View::make('mobile.privacy')->with(compact('page'))->render(); + } +} diff --git a/public/js/daci-17lx4qxke.js b/public/js/daci-17lx4qxke.js index 28a500b22..3cc6c601c 100644 Binary files a/public/js/daci-17lx4qxke.js and b/public/js/daci-17lx4qxke.js differ diff --git a/public/js/dffc-17lx4qxke.js b/public/js/dffc-17lx4qxke.js index a1198e1f2..d82b6e0f8 100644 Binary files a/public/js/dffc-17lx4qxke.js and b/public/js/dffc-17lx4qxke.js differ diff --git a/public/js/dmyh-17lx4qxke.js b/public/js/dmyh-17lx4qxke.js index 07d9879a8..73e4fb432 100644 Binary files a/public/js/dmyh-17lx4qxke.js and b/public/js/dmyh-17lx4qxke.js differ diff --git a/public/js/dmym-17lx4qxke.js b/public/js/dmym-17lx4qxke.js index 07dba14c0..f1fc8fa12 100644 Binary files a/public/js/dmym-17lx4qxke.js and b/public/js/dmym-17lx4qxke.js differ diff --git a/public/js/dsfc-17lx4qxke.js b/public/js/dsfc-17lx4qxke.js index b29c5435b..b70e5fd61 100644 Binary files a/public/js/dsfc-17lx4qxke.js and b/public/js/dsfc-17lx4qxke.js differ diff --git a/public/js/dssc-17lx4qxke.js b/public/js/dssc-17lx4qxke.js index 0ea7b1ce4..752f543f7 100644 Binary files a/public/js/dssc-17lx4qxke.js and b/public/js/dssc-17lx4qxke.js differ diff --git a/public/js/home-17lx4qxke.js b/public/js/home-17lx4qxke.js index 8b22b3f67..db7155436 100644 Binary files a/public/js/home-17lx4qxke.js and b/public/js/home-17lx4qxke.js differ diff --git a/public/js/post-17lx4qxke.js b/public/js/post-17lx4qxke.js index 7f0bf0c7b..d85b20a8e 100644 Binary files a/public/js/post-17lx4qxke.js and b/public/js/post-17lx4qxke.js differ diff --git a/public/js/profile-17lx4qxke.js b/public/js/profile-17lx4qxke.js index f0b50b83d..8468a210b 100644 Binary files a/public/js/profile-17lx4qxke.js and b/public/js/profile-17lx4qxke.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 50625b40e..72e63e7b4 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/views/mobile/privacy.blade.php b/resources/views/mobile/privacy.blade.php new file mode 100644 index 000000000..35dece3b9 --- /dev/null +++ b/resources/views/mobile/privacy.blade.php @@ -0,0 +1,105 @@ +@extends('layouts.blank') + +@section('content') +
Last Updated: Sept 28, 2022
+ +Any of the information we collect from you may be used in the following ways:
+We implement a variety of security measures to maintain the safety of your personal information when you enter, submit, or access your personal information. Among other things, your browser session, as well as the traffic between your applications and the API, are secured with SSL, and your password is hashed using a strong one-way algorithm. You may enable two-factor authentication to further secure access to your account.
+ + +We will make a good faith effort to:
+You may irreversibly delete your account at any time.
+ +Yes. Cookies are small files that a site or its service provider transfers to your computer’s hard drive through your Web browser (if you allow). These cookies enable the site to recognize your browser and, if you have a registered account, associate it with your registered account. +
+We use cookies to understand and save your preferences for future visits.
+ +We do not sell, trade, or otherwise transfer to outside parties your personally identifiable information. This does not include trusted third parties who assist us in operating our site, conducting our business, or servicing you, so long as those parties agree to keep this information confidential. We may also release your information when we believe release is appropriate to comply with the law, enforce our site policies, or protect ours or others rights, property, or safety.
+Your public content may be downloaded by other servers in the network. Your public and followers-only posts are delivered to the servers where your followers reside, and direct messages are delivered to the servers of the recipients, in so far as those followers or recipients reside on a different server than this.
+When you authorize an application to use your account, depending on the scope of permissions you approve, it may access your public profile information, your following list, your followers, your lists, all your posts, and your favourites. Applications can never access your e-mail address or password.
+ +If this server is in the EU or the EEA: Our site, products and services are all directed to people who are at least 16 years old. If you are under the age of 16, per the requirements of the GDPR (General Data Protection Regulation) do not use this site.
+ +If this server is in the USA: Our site, products and services are all directed to people who are at least 13 years old. If you are under the age of 13, per the requirements of COPPA (Children's Online Privacy Protection Act) do not use this site.
+ +Law requirements can be different if this server is in another jurisdiction.
+ +If we decide to change our privacy policy, we will post those changes on this page.
+ +This document is CC-BY-SA. It was last updated Jun 12, 2018.
+ +Originally adapted from the Mastodon privacy policy.
+Last Updated: Sept 28, 2022
+By accessing the website at {{config('app.url')}}, you are agreeing to be bound by these terms of service, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this site. The materials contained in this website are protected by applicable copyright and trademark law.
+In no event shall Pixelfed or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption) arising out of the use or inability to use the materials on Pixelfed's website, even if Pixelfed or a Pixelfed authorized representative has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you.
+The materials appearing on Pixelfed's website could include technical, typographical, or photographic errors. Pixelfed does not warrant that any of the materials on its website are accurate, complete or current. Pixelfed may make changes to the materials contained on its website at any time without notice. However Pixelfed does not make any commitment to update the materials.
+Pixelfed has not reviewed all of the sites linked to its website and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by Pixelfed of the site. Use of any such linked website is at the user's own risk.
+Pixelfed may revise these terms of service for its website at any time without notice. By using this website you are agreeing to be bound by the then current version of these terms of service.
+These terms and conditions are governed by and construed in accordance with the laws of Canada and you irrevocably submit to the exclusive jurisdiction of the courts in that State or location.
+