Browse Source

Merge pull request #3264 from pixelfed/staging

Staging
daniel 3 years ago
parent
commit
3bf3289b57

+ 2 - 0
CHANGELOG.md

@@ -57,6 +57,8 @@
 - Updated ComposeController, add collection support to compose endpoint. ([ec2cfaf5](https://github.com/pixelfed/pixelfed/commit/ec2cfaf5))
 - Updated instance config, match default oauth settings in AuthServiceProvider. ([52f25ff1](https://github.com/pixelfed/pixelfed/commit/52f25ff1))
 - Updated ComposeModal.vue, fix redirect after posting. Fixes #3254. ([5db64e94](https://github.com/pixelfed/pixelfed/commit/5db64e94))
+- Updated StatusController, redirect status view for authed users to Metro 2.0 UI. ([71dff472](https://github.com/pixelfed/pixelfed/commit/71dff472))
+- Updated ProfileController, redirect profile view for authed users to Metro 2.0 UI. ([7f8129a7](https://github.com/pixelfed/pixelfed/commit/7f8129a7))
 -  ([](https://github.com/pixelfed/pixelfed/commit/))
 
 ## [v0.11.2 (2022-01-09)](https://github.com/pixelfed/pixelfed/compare/v0.11.1...v0.11.2)

+ 11 - 0
app/Http/Controllers/ProfileController.php

@@ -26,6 +26,17 @@ class ProfileController extends Controller
 {
 	public function show(Request $request, $username)
 	{
+		// redirect authed users to Metro 2.0
+		if($request->user()) {
+			// unless they force static view
+			if(!$request->has('fs') || $request->input('fs') != '1') {
+				$pid = AccountService::usernameToId($username);
+				if($pid) {
+					return redirect('/i/web/profile/' . $pid);
+				}
+			}
+		}
+
 		$user = Profile::whereNull('domain')
 			->whereNull('status')
 			->whereUsername($username)

+ 8 - 0
app/Http/Controllers/StatusController.php

@@ -31,6 +31,14 @@ class StatusController extends Controller
 {
 	public function show(Request $request, $username, $id)
 	{
+		// redirect authed users to Metro 2.0
+		if($request->user()) {
+			// unless they force static view
+			if(!$request->has('fs') || $request->input('fs') != '1') {
+				return redirect('/i/web/post/' . $id);
+			}
+		}
+
 		$user = Profile::whereNull('domain')->whereUsername($username)->firstOrFail();
 
 		if($user->status != null) {

BIN
public/js/compose-chunk.js


BIN
public/js/compose.js


BIN
public/js/home-chunk.js


BIN
public/js/post-chunk.js


BIN
public/js/profile-chunk.js


BIN
public/mix-manifest.json