mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-13 01:54:30 +00:00
commit
a34fe00114
32 changed files with 779 additions and 508 deletions
13
CHANGELOG.md
13
CHANGELOG.md
|
@ -1,6 +1,8 @@
|
||||||
# Release Notes
|
# Release Notes
|
||||||
|
|
||||||
## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.10.10...dev)
|
## [Unreleased](https://github.com/pixelfed/pixelfed/compare/v0.11.0...dev)
|
||||||
|
|
||||||
|
## [v0.11.0 (2021-06-01)](https://github.com/pixelfed/pixelfed/compare/v0.10.10...v0.11.0)
|
||||||
### Added
|
### Added
|
||||||
- Autocomplete Support (hashtags + mentions) ([de514f7d](https://github.com/pixelfed/pixelfed/commit/de514f7d))
|
- Autocomplete Support (hashtags + mentions) ([de514f7d](https://github.com/pixelfed/pixelfed/commit/de514f7d))
|
||||||
- Creative Commons Licenses ([552e950](https://github.com/pixelfed/pixelfed/commit/552e950))
|
- Creative Commons Licenses ([552e950](https://github.com/pixelfed/pixelfed/commit/552e950))
|
||||||
|
@ -11,6 +13,7 @@
|
||||||
- New admin dashboard layout ([eb7d5a4e](https://github.com/pixelfed/pixelfed/commit/eb7d5a4e))
|
- New admin dashboard layout ([eb7d5a4e](https://github.com/pixelfed/pixelfed/commit/eb7d5a4e))
|
||||||
- Fresh about page layout ([92dc7af6](https://github.com/pixelfed/pixelfed/commit/92dc7af6))
|
- Fresh about page layout ([92dc7af6](https://github.com/pixelfed/pixelfed/commit/92dc7af6))
|
||||||
- Instance Rules ([a4efbb75](https://github.com/pixelfed/pixelfed/commit/a4efbb75))
|
- Instance Rules ([a4efbb75](https://github.com/pixelfed/pixelfed/commit/a4efbb75))
|
||||||
|
- New Home Timeline ([56215be7](https://github.com/pixelfed/pixelfed/commit/56215be7))
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
- Updated AdminController, fix variable name in updateSpam method. ([6edaf940](https://github.com/pixelfed/pixelfed/commit/6edaf940))
|
- Updated AdminController, fix variable name in updateSpam method. ([6edaf940](https://github.com/pixelfed/pixelfed/commit/6edaf940))
|
||||||
|
@ -102,7 +105,13 @@
|
||||||
- Updated Timeline component, show counts and make sidebar footer lighter. ([0788bffa](https://github.com/pixelfed/pixelfed/commit/0788bffa))
|
- Updated Timeline component, show counts and make sidebar footer lighter. ([0788bffa](https://github.com/pixelfed/pixelfed/commit/0788bffa))
|
||||||
- Updated AuthServiceProvider, increase default token + refresh token lifetime. ([178ed63d](https://github.com/pixelfed/pixelfed/commit/178ed63d))
|
- Updated AuthServiceProvider, increase default token + refresh token lifetime. ([178ed63d](https://github.com/pixelfed/pixelfed/commit/178ed63d))
|
||||||
- Updated liked by, fix remote username urls. ([f767d99a](https://github.com/pixelfed/pixelfed/commit/f767d99a))
|
- Updated liked by, fix remote username urls. ([f767d99a](https://github.com/pixelfed/pixelfed/commit/f767d99a))
|
||||||
- ([](https://github.com/pixelfed/pixelfed/commit/))
|
- Updated StatusController, add cache invalidation for timeline cursor. ([f3bf2fd4](https://github.com/pixelfed/pixelfed/commit/f3bf2fd4))
|
||||||
|
- Updated PublicApiController, add recent feed support to home timeline. ([1e230e80](https://github.com/pixelfed/pixelfed/commit/1e230e80))
|
||||||
|
- Updated Inbox, fix reply/comment bug by moving attachment validation to Note with attachments. ([28df9f7e](https://github.com/pixelfed/pixelfed/commit/28df9f7e))
|
||||||
|
- Updated PrettyNumber, add decimal option. ([84520fe1](https://github.com/pixelfed/pixelfed/commit/84520fe1))
|
||||||
|
- Updated app config, change default descriptions. ([7d24560d](https://github.com/pixelfed/pixelfed/commit/7d24560d))
|
||||||
|
- Updated NotificationCard, fix loading bug. ([69567e19](https://github.com/pixelfed/pixelfed/commit/69567e19))
|
||||||
|
- Updated DirectMessageController, disable exception logging for invalid urls. Fixes ([#2752](https://github.com/pixelfed/pixelfed/issues/2752)). ([2d0a253e](https://github.com/pixelfed/pixelfed/commit/2d0a253e))
|
||||||
|
|
||||||
## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)
|
## [v0.10.10 (2021-01-28)](https://github.com/pixelfed/pixelfed/compare/v0.10.9...v0.10.10)
|
||||||
### Added
|
### Added
|
||||||
|
|
|
@ -5,6 +5,7 @@ namespace App\Exceptions;
|
||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||||
use Throwable;
|
use Throwable;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
|
use Zttp\ConnectionException;
|
||||||
|
|
||||||
class Handler extends ExceptionHandler
|
class Handler extends ExceptionHandler
|
||||||
{
|
{
|
||||||
|
@ -14,7 +15,8 @@ class Handler extends ExceptionHandler
|
||||||
* @var array
|
* @var array
|
||||||
*/
|
*/
|
||||||
protected $dontReport = [
|
protected $dontReport = [
|
||||||
OAuthServerException::class
|
OAuthServerException::class,
|
||||||
|
ConnectionException::class
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -596,6 +596,10 @@ class DirectMessageController extends Controller
|
||||||
$q = $request->input('q');
|
$q = $request->input('q');
|
||||||
$r = $request->input('remote');
|
$r = $request->input('remote');
|
||||||
|
|
||||||
|
if(!Str::of($q)->contains('.')) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
if($r && Helpers::validateUrl($q)) {
|
if($r && Helpers::validateUrl($q)) {
|
||||||
Helpers::profileFetch($q);
|
Helpers::profileFetch($q);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ use App\{
|
||||||
Profile,
|
Profile,
|
||||||
StatusHashtag,
|
StatusHashtag,
|
||||||
Status,
|
Status,
|
||||||
|
StatusView,
|
||||||
UserFilter
|
UserFilter
|
||||||
};
|
};
|
||||||
use Auth,Cache;
|
use Auth,Cache;
|
||||||
|
@ -376,9 +377,13 @@ class PublicApiController extends Controller
|
||||||
'page' => 'nullable|integer|max:40',
|
'page' => 'nullable|integer|max:40',
|
||||||
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
'min_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
||||||
'max_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
'max_id' => 'nullable|integer|min:0|max:' . PHP_INT_MAX,
|
||||||
'limit' => 'nullable|integer|max:40'
|
'limit' => 'nullable|integer|max:40',
|
||||||
|
'recent_feed' => 'nullable',
|
||||||
|
'recent_min' => 'nullable|integer'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
$recentFeed = $request->input('recent_feed') == 'true';
|
||||||
|
$recentFeedMin = $request->input('recent_min');
|
||||||
$page = $request->input('page');
|
$page = $request->input('page');
|
||||||
$min = $request->input('min_id');
|
$min = $request->input('min_id');
|
||||||
$max = $request->input('max_id');
|
$max = $request->input('max_id');
|
||||||
|
@ -393,29 +398,21 @@ class PublicApiController extends Controller
|
||||||
return;
|
return;
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Use redis for timelines
|
$pid = Auth::user()->profile_id;
|
||||||
// $timeline = Timeline::build()->local();
|
|
||||||
$pid = Auth::user()->profile->id;
|
|
||||||
|
|
||||||
$following = Cache::remember('profile:following:'.$pid, now()->addMinutes(1440), function() use($pid) {
|
$following = Cache::remember('profile:following:'.$pid, now()->addMinutes(1440), function() use($pid) {
|
||||||
$following = Follower::whereProfileId($pid)->pluck('following_id');
|
$following = Follower::whereProfileId($pid)->pluck('following_id');
|
||||||
return $following->push($pid)->toArray();
|
return $following->push($pid)->toArray();
|
||||||
});
|
});
|
||||||
|
|
||||||
// $private = Cache::remember('profiles:private', now()->addMinutes(1440), function() {
|
if($recentFeed == true) {
|
||||||
// return Profile::whereIsPrivate(true)
|
$key = 'profile:home-timeline-cursor:'.$user->id;
|
||||||
// ->orWhere('unlisted', true)
|
$ttl = now()->addMinutes(30);
|
||||||
// ->orWhere('status', '!=', null)
|
$min = Cache::remember($key, $ttl, function() use($pid) {
|
||||||
// ->pluck('id');
|
$res = StatusView::whereProfileId($pid)->orderByDesc('status_id')->first();
|
||||||
// });
|
return $res ? $res->status_id : null;
|
||||||
|
});
|
||||||
// $private = $private->diff($following)->flatten();
|
}
|
||||||
|
|
||||||
// $filters = UserFilter::whereUserId($pid)
|
|
||||||
// ->whereFilterableType('App\Profile')
|
|
||||||
// ->whereIn('filter_type', ['mute', 'block'])
|
|
||||||
// ->pluck('filterable_id')->toArray();
|
|
||||||
// $filtered = array_merge($private->toArray(), $filters);
|
|
||||||
|
|
||||||
$filtered = Auth::check() ? UserFilterService::filters(Auth::user()->profile_id) : [];
|
$filtered = Auth::check() ? UserFilterService::filters(Auth::user()->profile_id) : [];
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ use App\StatusView;
|
||||||
use App\Transformer\ActivityPub\StatusTransformer;
|
use App\Transformer\ActivityPub\StatusTransformer;
|
||||||
use App\Transformer\ActivityPub\Verb\Note;
|
use App\Transformer\ActivityPub\Verb\Note;
|
||||||
use App\User;
|
use App\User;
|
||||||
use Auth, Cache;
|
use Auth, DB, Cache;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use League\Fractal;
|
use League\Fractal;
|
||||||
use App\Util\Media\Filter;
|
use App\Util\Media\Filter;
|
||||||
|
@ -75,12 +75,6 @@ class StatusController extends Controller
|
||||||
}
|
}
|
||||||
|
|
||||||
$template = $status->in_reply_to_id ? 'status.reply' : 'status.show';
|
$template = $status->in_reply_to_id ? 'status.reply' : 'status.show';
|
||||||
// $template = $status->type === 'video' &&
|
|
||||||
// $request->has('video_beta') &&
|
|
||||||
// $request->video_beta == 1 &&
|
|
||||||
// $request->user() ?
|
|
||||||
// 'status.show_video' : 'status.show';
|
|
||||||
|
|
||||||
return view($template, compact('user', 'status'));
|
return view($template, compact('user', 'status'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -403,27 +397,27 @@ class StatusController extends Controller
|
||||||
public function storeView(Request $request)
|
public function storeView(Request $request)
|
||||||
{
|
{
|
||||||
abort_if(!$request->user(), 403);
|
abort_if(!$request->user(), 403);
|
||||||
$this->validate($request, [
|
|
||||||
'_v' => 'required|array'
|
|
||||||
]);
|
|
||||||
|
|
||||||
$views = $request->input('_v');
|
$views = $request->input('_v');
|
||||||
$uid = $request->user()->profile_id;
|
$uid = $request->user()->profile_id;
|
||||||
|
|
||||||
if(empty($views)) {
|
if(empty($views) || !is_array($views)) {
|
||||||
return;
|
return response()->json(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Cache::forget('profile:home-timeline-cursor:' . $request->user()->id);
|
||||||
|
|
||||||
foreach($views as $view) {
|
foreach($views as $view) {
|
||||||
if(!isset($view['sid']) || !isset($view['pid'])) {
|
if(!isset($view['sid']) || !isset($view['pid'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
DB::transaction(function () use($view, $uid) {
|
||||||
StatusView::firstOrCreate([
|
StatusView::firstOrCreate([
|
||||||
'status_id' => $view['sid'],
|
'status_id' => $view['sid'],
|
||||||
'status_profile_id' => $view['pid'],
|
'status_profile_id' => $view['pid'],
|
||||||
'profile_id' => $uid
|
'profile_id' => $uid
|
||||||
]);
|
]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json(1);
|
return response()->json(1);
|
||||||
|
|
|
@ -154,13 +154,13 @@ class Inbox
|
||||||
$this->handleDirectMessage();
|
$this->handleDirectMessage();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(!$this->verifyNoteAttachment()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if($activity['type'] == 'Note' && !empty($activity['inReplyTo'])) {
|
if($activity['type'] == 'Note' && !empty($activity['inReplyTo'])) {
|
||||||
$this->handleNoteReply();
|
$this->handleNoteReply();
|
||||||
|
|
||||||
} elseif($activity['type'] == 'Note' && !empty($activity['attachment'])) {
|
} elseif($activity['type'] == 'Note' && !empty($activity['attachment'])) {
|
||||||
|
if(!$this->verifyNoteAttachment()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
$this->handleNoteCreate();
|
$this->handleNoteCreate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace App\Util\Lexer;
|
||||||
|
|
||||||
class PrettyNumber
|
class PrettyNumber
|
||||||
{
|
{
|
||||||
public static function convert($number)
|
public static function convert($number, $showDecimals = true)
|
||||||
{
|
{
|
||||||
if(!is_integer($number)) {
|
if(!is_integer($number)) {
|
||||||
return $number;
|
return $number;
|
||||||
|
@ -14,7 +14,7 @@ class PrettyNumber
|
||||||
foreach ($abbrevs as $exponent => $abbrev) {
|
foreach ($abbrevs as $exponent => $abbrev) {
|
||||||
if(abs($number) >= pow(10, $exponent)) {
|
if(abs($number) >= pow(10, $exponent)) {
|
||||||
$display = $number / pow(10, $exponent);
|
$display = $number / pow(10, $exponent);
|
||||||
$decimals = ($exponent >= 3 && round($display) < 100) ? 1 : 0;
|
$decimals = !$showDecimals ? 0 : ($exponent >= 3 && round($display) < 100) ? 1 : 0;
|
||||||
$number = number_format($display, $decimals).$abbrev;
|
$number = number_format($display, $decimals).$abbrev;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,8 +108,8 @@ return [
|
||||||
|
|
||||||
'cipher' => 'AES-256-CBC',
|
'cipher' => 'AES-256-CBC',
|
||||||
|
|
||||||
'short_description' => 'Pixelfed - Photo sharing for everyone',
|
'short_description' => 'Pixelfed is an image sharing platform, an ethical alternative to centralized platforms.',
|
||||||
'description' => 'Pixelfed - Photo sharing for everyone',
|
'description' => 'Pixelfed is an image sharing platform, an ethical alternative to centralized platforms.',
|
||||||
'rules' => null,
|
'rules' => null,
|
||||||
'logo' => '/img/pixelfed-icon-color.svg',
|
'logo' => '/img/pixelfed-icon-color.svg',
|
||||||
|
|
||||||
|
|
|
@ -2,280 +2,280 @@
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Domains
|
| Domains
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Application domains used for routing
|
| Application domains used for routing
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'domain' => [
|
'domain' => [
|
||||||
'admin' => env('ADMIN_DOMAIN'),
|
'admin' => env('ADMIN_DOMAIN'),
|
||||||
'app' => env('APP_DOMAIN'),
|
'app' => env('APP_DOMAIN'),
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Pixelfed Version
|
| Pixelfed Version
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This value is the version of your Pixelfed instance.
|
| This value is the version of your Pixelfed instance.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'version' => '0.10.10',
|
'version' => '0.11.0',
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| NodeInfo Route Path
|
| NodeInfo Route Path
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Do not change this value unless you know what you are doing.
|
| Do not change this value unless you know what you are doing.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'nodeinfo' => [
|
'nodeinfo' => [
|
||||||
'url' => config('app.url').'/api/nodeinfo/2.0.json',
|
'url' => config('app.url').'/api/nodeinfo/2.0.json',
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| PHP/ImageMagic/GD Memory Limit
|
| PHP/ImageMagic/GD Memory Limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| This memory_limit value is only used for image processing. The
|
| This memory_limit value is only used for image processing. The
|
||||||
| default memory_limit php.ini is used for the rest of the app.
|
| default memory_limit php.ini is used for the rest of the app.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'memory_limit' => env('MEMORY_LIMIT', '1024M'),
|
'memory_limit' => env('MEMORY_LIMIT', '1024M'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Allow New Registrations
|
| Allow New Registrations
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Enable/disable new local account registrations.
|
| Enable/disable new local account registrations.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'open_registration' => env('OPEN_REGISTRATION', true),
|
'open_registration' => env('OPEN_REGISTRATION', true),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Account file size limit
|
| Account file size limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Update the max account size, the per user limit of files in KB.
|
| Update the max account size, the per user limit of files in KB.
|
||||||
|
|
|
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_account_size' => env('MAX_ACCOUNT_SIZE', 1000000),
|
'max_account_size' => env('MAX_ACCOUNT_SIZE', 1000000),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Photo file size limit
|
| Photo file size limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Update the max photo size, in KB.
|
| Update the max photo size, in KB.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_photo_size' => env('MAX_PHOTO_SIZE', 15000),
|
'max_photo_size' => env('MAX_PHOTO_SIZE', 15000),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Avatar file size limit
|
| Avatar file size limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Update the max avatar size, in KB.
|
| Update the max avatar size, in KB.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_avatar_size' => (int) env('MAX_AVATAR_SIZE', 2000),
|
'max_avatar_size' => (int) env('MAX_AVATAR_SIZE', 2000),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Caption limit
|
| Caption limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Change the caption length limit for new local posts.
|
| Change the caption length limit for new local posts.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_caption_length' => env('MAX_CAPTION_LENGTH', 500),
|
'max_caption_length' => env('MAX_CAPTION_LENGTH', 500),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Bio length limit
|
| Bio length limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Change the bio length limit for user profiles.
|
| Change the bio length limit for user profiles.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_bio_length' => env('MAX_BIO_LENGTH', 125),
|
'max_bio_length' => env('MAX_BIO_LENGTH', 125),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| User name length limit
|
| User name length limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Change the length limit for user names.
|
| Change the length limit for user names.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_name_length' => env('MAX_NAME_LENGTH', 30),
|
'max_name_length' => env('MAX_NAME_LENGTH', 30),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Password minimum length limit
|
| Password minimum length limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Change the minimum length limit for user passwords.
|
| Change the minimum length limit for user passwords.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'min_password_length' => env('MIN_PASSWORD_LENGTH', 12),
|
'min_password_length' => env('MIN_PASSWORD_LENGTH', 8),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Album size limit
|
| Album size limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| The max number of photos allowed per post.
|
| The max number of photos allowed per post.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_album_length' => env('MAX_ALBUM_LENGTH', 4),
|
'max_album_length' => env('MAX_ALBUM_LENGTH', 4),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Email Verification
|
| Email Verification
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Require email verification before a new user can do anything.
|
| Require email verification before a new user can do anything.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'enforce_email_verification' => env('ENFORCE_EMAIL_VERIFICATION', true),
|
'enforce_email_verification' => env('ENFORCE_EMAIL_VERIFICATION', true),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Image Quality
|
| Image Quality
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Set the image optimization quality, must be a value between 1-100.
|
| Set the image optimization quality, must be a value between 1-100.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'image_quality' => (int) env('IMAGE_QUALITY', 80),
|
'image_quality' => (int) env('IMAGE_QUALITY', 80),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Account deletion
|
| Account deletion
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Enable account deletion.
|
| Enable account deletion.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'account_deletion' => env('ACCOUNT_DELETION', true),
|
'account_deletion' => env('ACCOUNT_DELETION', true),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Account deletion after X days
|
| Account deletion after X days
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Set account deletion queue after X days, set to false to delete accounts
|
| Set account deletion queue after X days, set to false to delete accounts
|
||||||
| immediately.
|
| immediately.
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'account_delete_after' => env('ACCOUNT_DELETE_AFTER', false),
|
'account_delete_after' => env('ACCOUNT_DELETE_AFTER', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Enable Cloud Storage
|
| Enable Cloud Storage
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Store media on object storage like S3, Digital Ocean Spaces, Rackspace
|
| Store media on object storage like S3, Digital Ocean Spaces, Rackspace
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'cloud_storage' => env('PF_ENABLE_CLOUD', false),
|
'cloud_storage' => env('PF_ENABLE_CLOUD', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Max User Limit
|
| Max User Limit
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Allow a maximum number of user accounts. Default: off
|
| Allow a maximum number of user accounts. Default: off
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'max_users' => env('PF_MAX_USERS', false),
|
'max_users' => env('PF_MAX_USERS', false),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Optimize Images
|
| Optimize Images
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Resize and optimize image uploads. Default: on
|
| Resize and optimize image uploads. Default: on
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'optimize_image' => env('PF_OPTIMIZE_IMAGES', true),
|
'optimize_image' => env('PF_OPTIMIZE_IMAGES', true),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Optimize Videos
|
| Optimize Videos
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Resize and optimize video uploads. Default: on
|
| Resize and optimize video uploads. Default: on
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'optimize_video' => env('PF_OPTIMIZE_VIDEOS', true),
|
'optimize_video' => env('PF_OPTIMIZE_VIDEOS', true),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| User invites
|
| User invites
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Allow users to invite others via email.
|
| Allow users to invite others via email.
|
||||||
| Will respect max user limit and prevent invites after the
|
| Will respect max user limit and prevent invites after the
|
||||||
| limit is reached. Default: off
|
| limit is reached. Default: off
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'user_invites' => [
|
'user_invites' => [
|
||||||
'enabled' => env('PF_USER_INVITES', false),
|
'enabled' => env('PF_USER_INVITES', false),
|
||||||
'limit' => [
|
'limit' => [
|
||||||
'total' => (int) env('PF_USER_INVITES_TOTAL_LIMIT', 0),
|
'total' => (int) env('PF_USER_INVITES_TOTAL_LIMIT', 0),
|
||||||
'daily' => (int) env('PF_USER_INVITES_DAILY_LIMIT', 0),
|
'daily' => (int) env('PF_USER_INVITES_DAILY_LIMIT', 0),
|
||||||
'monthly' => (int) env('PF_USER_INVITES_MONTHLY_LIMIT', 0),
|
'monthly' => (int) env('PF_USER_INVITES_MONTHLY_LIMIT', 0),
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
'max_collection_length' => (int) env('PF_MAX_COLLECTION_LENGTH', 18),
|
'max_collection_length' => (int) env('PF_MAX_COLLECTION_LENGTH', 18),
|
||||||
|
|
||||||
'media_types' => env('MEDIA_TYPES', 'image/jpeg,image/png,image/gif'),
|
'media_types' => env('MEDIA_TYPES', 'image/jpeg,image/png,image/gif'),
|
||||||
|
|
||||||
'enforce_account_limit' => env('LIMIT_ACCOUNT_SIZE', true),
|
'enforce_account_limit' => env('LIMIT_ACCOUNT_SIZE', true),
|
||||||
|
|
||||||
'import' => [
|
'import' => [
|
||||||
'instagram' => [
|
'instagram' => [
|
||||||
'enabled' => env('IMPORT_INSTAGRAM', false),
|
'enabled' => env('IMPORT_INSTAGRAM', false),
|
||||||
'limits' => [
|
'limits' => [
|
||||||
'posts' => (int) env('IMPORT_INSTAGRAM_POST_LIMIT', 100),
|
'posts' => (int) env('IMPORT_INSTAGRAM_POST_LIMIT', 100),
|
||||||
'size' => (int) env('IMPORT_INSTAGRAM_SIZE_LIMIT', 5000)
|
'size' => (int) env('IMPORT_INSTAGRAM_SIZE_LIMIT', 5000)
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
|
||||||
'oauth_enabled' => env('OAUTH_ENABLED', false),
|
'oauth_enabled' => env('OAUTH_ENABLED', false),
|
||||||
|
|
||||||
'admin' => [
|
'admin' => [
|
||||||
'env_editor' => env('ADMIN_ENV_EDITOR', false)
|
'env_editor' => env('ADMIN_ENV_EDITOR', false)
|
||||||
],
|
],
|
||||||
|
|
||||||
'bouncer' => [
|
'bouncer' => [
|
||||||
'enabled' => env('PF_BOUNCER_ENABLED', false),
|
'enabled' => env('PF_BOUNCER_ENABLED', false),
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Media Fast Process
|
| Media Fast Process
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
|
||||||
| Don't require photos & video to finish optimization &
|
| Don't require photos & video to finish optimization &
|
||||||
| upload to S3 if enabled before posting. If disabled
|
| upload to S3 if enabled before posting. If disabled
|
||||||
| users will have to wait until processed before posting,
|
| users will have to wait until processed before posting,
|
||||||
| sacrificing the user experience to ensure media is federated
|
| sacrificing the user experience to ensure media is federated
|
||||||
| using S3 urls (if enabled). Default: off
|
| using S3 urls (if enabled). Default: off
|
||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
'media_fast_process' => env('PF_MEDIA_FAST_PROCESS', true),
|
'media_fast_process' => env('PF_MEDIA_FAST_PROCESS', true),
|
||||||
];
|
];
|
||||||
|
|
|
@ -27,8 +27,7 @@ class AddFiltersToMediaTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('media', function (Blueprint $table) {
|
Schema::table('media', function (Blueprint $table) {
|
||||||
$table->dropColumn('filter_name');
|
$table->dropColumn(['filter_name','filter_class']);
|
||||||
$table->dropColumn('filter_class');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,7 @@ class Add2faToUsersTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->dropColumn('2fa_enabled');
|
$table->dropColumn(['2fa_enabled','2fa_secret','2fa_backup_codes','2fa_setup_at']);
|
||||||
$table->dropColumn('2fa_secret');
|
|
||||||
$table->dropColumn('2fa_backup_codes');
|
|
||||||
$table->dropColumn('2fa_setup_at');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,10 +29,7 @@ class UpdateSettingsTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('user_settings', function (Blueprint $table) {
|
Schema::table('user_settings', function (Blueprint $table) {
|
||||||
$table->dropColumn('show_profile_followers');
|
$table->dropColumn(['show_profile_followers','show_profile_follower_count','show_profile_following','show_profile_following_count']);
|
||||||
$table->dropColumn('show_profile_follower_count');
|
|
||||||
$table->dropColumn('show_profile_following');
|
|
||||||
$table->dropColumn('show_profile_following_count');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,13 +32,7 @@ class UpdateMediaTableAddAltText extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('media', function (Blueprint $table) {
|
Schema::table('media', function (Blueprint $table) {
|
||||||
$table->dropColumn('original_sha256');
|
$table->dropColumn(['original_sha256','optimized_sha256','caption','hls_path','hls_transcoded_at','key','metadata']);
|
||||||
$table->dropColumn('optimized_sha256');
|
|
||||||
$table->dropColumn('caption');
|
|
||||||
$table->dropColumn('hls_path');
|
|
||||||
$table->dropColumn('hls_transcoded_at');
|
|
||||||
$table->dropColumn('key');
|
|
||||||
$table->dropColumn('metadata');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,7 @@ class UpdateFollowerTableAddRemoteFlags extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('followers', function (Blueprint $table) {
|
Schema::table('followers', function (Blueprint $table) {
|
||||||
$table->dropColumn('local_profile');
|
$table->dropColumn(['local_profile','local_following']);
|
||||||
$table->dropColumn('local_following');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,11 +30,7 @@ class UpdateMediaAddAltText extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('media', function (Blueprint $table) {
|
Schema::table('media', function (Blueprint $table) {
|
||||||
$table->dropColumn('license');
|
$table->dropColumn(['license','is_nsfw','version','remote_media','remote_url']);
|
||||||
$table->dropColumn('is_nsfw');
|
|
||||||
$table->dropColumn('version');
|
|
||||||
$table->dropColumn('remote_media');
|
|
||||||
$table->dropColumn('remote_url');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,7 @@ class AddAccountStatusToProfilesTable extends Migration
|
||||||
// Drop old columns, fix stories
|
// Drop old columns, fix stories
|
||||||
if(Schema::hasColumn('profiles', 'hub_url')) {
|
if(Schema::hasColumn('profiles', 'hub_url')) {
|
||||||
Schema::table('profiles', function (Blueprint $table) {
|
Schema::table('profiles', function (Blueprint $table) {
|
||||||
$table->dropColumn('verify_token');
|
$table->dropColumn(['verify_token','secret','salmon_url','hub_url']);
|
||||||
$table->dropColumn('secret');
|
|
||||||
$table->dropColumn('salmon_url');
|
|
||||||
$table->dropColumn('hub_url');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,9 +28,7 @@ class UpdateProfilesTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('profiles', function (Blueprint $table) {
|
Schema::table('profiles', function (Blueprint $table) {
|
||||||
$table->dropColumn('unlisted');
|
$table->dropColumn(['unlisted','cw','no_autolink']);
|
||||||
$table->dropColumn('cw');
|
|
||||||
$table->dropColumn('no_autolink');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,12 +62,7 @@ class Stories extends Migration
|
||||||
Schema::dropIfExists('story_views');
|
Schema::dropIfExists('story_views');
|
||||||
|
|
||||||
Schema::table('stories', function (Blueprint $table) {
|
Schema::table('stories', function (Blueprint $table) {
|
||||||
$table->dropColumn('title');
|
$table->dropColumn(['title','preview_photo','local_only','is_live','broadcast_url','broadcast_key']);
|
||||||
$table->dropColumn('preview_photo');
|
|
||||||
$table->dropColumn('local_only');
|
|
||||||
$table->dropColumn('is_live');
|
|
||||||
$table->dropColumn('broadcast_url');
|
|
||||||
$table->dropColumn('broadcast_key');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::table('story_reactions', function (Blueprint $table) {
|
Schema::table('story_reactions', function (Blueprint $table) {
|
||||||
|
|
|
@ -27,8 +27,7 @@ class AddRemoteToAvatarsTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('avatars', function (Blueprint $table) {
|
Schema::table('avatars', function (Blueprint $table) {
|
||||||
$table->dropColumn('remote_url');
|
$table->dropColumn(['remote_url','last_fetched_at']);
|
||||||
$table->dropColumn('last_fetched_at');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,7 @@ class AddRepliesCountToStatusesTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('statuses', function (Blueprint $table) {
|
Schema::table('statuses', function (Blueprint $table) {
|
||||||
$table->dropColumn('reply_count');
|
$table->dropColumn(['reply_count','comments_disabled']);
|
||||||
$table->dropColumn('comments_disabled');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,7 @@ class AddLayoutToProfilesTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('profiles', function (Blueprint $table) {
|
Schema::table('profiles', function (Blueprint $table) {
|
||||||
$table->dropColumn('profile_layout');
|
$table->dropColumn(['profile_layout','post_layout']);
|
||||||
$table->dropColumn('post_layout');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,39 +6,34 @@ use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddFetchedAtToProfilesTable extends Migration
|
class AddFetchedAtToProfilesTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('profiles', function (Blueprint $table) {
|
Schema::table('profiles', function (Blueprint $table) {
|
||||||
$table->timestamp('last_fetched_at')->nullable();
|
$table->timestamp('last_fetched_at')->nullable();
|
||||||
$table->unsignedInteger('status_count')->default(0)->nullable();
|
$table->unsignedInteger('status_count')->default(0)->nullable();
|
||||||
$table->unsignedInteger('followers_count')->default(0)->nullable();
|
$table->unsignedInteger('followers_count')->default(0)->nullable();
|
||||||
$table->unsignedInteger('following_count')->default(0)->nullable();
|
$table->unsignedInteger('following_count')->default(0)->nullable();
|
||||||
$table->string('webfinger')->unique()->nullable()->index();
|
$table->string('webfinger')->unique()->nullable()->index();
|
||||||
$table->string('avatar_url')->nullable();
|
$table->string('avatar_url')->nullable();
|
||||||
$table->dropColumn('keybase_proof');
|
$table->dropColumn('keybase_proof');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('profiles', function (Blueprint $table) {
|
Schema::table('profiles', function (Blueprint $table) {
|
||||||
$table->dropColumn('last_fetched_at');
|
$table->dropColumn(['last_fetched_at','status_count','followers_count','following_count','webfinger','avatar_url']);
|
||||||
$table->dropColumn('status_count');
|
$table->text('keybase_proof')->nullable()->after('post_layout');
|
||||||
$table->dropColumn('followers_count');
|
});
|
||||||
$table->dropColumn('following_count');
|
}
|
||||||
$table->dropColumn('webfinger');
|
|
||||||
$table->dropColumn('avatar_url');
|
|
||||||
$table->text('keybase_proof')->nullable()->after('post_layout');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,16 +36,10 @@ class AddRemoteUrlToStoriesTable extends Migration
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('stories', function (Blueprint $table) {
|
Schema::table('stories', function (Blueprint $table) {
|
||||||
$table->dropColumn('remote_url');
|
$table->dropColumn(['remote_url','media_url','is_archived','name']);
|
||||||
$table->dropColumn('media_url');
|
|
||||||
$table->dropColumn('is_archived');
|
|
||||||
$table->dropColumn('name');
|
|
||||||
});
|
});
|
||||||
Schema::table('media', function (Blueprint $table) {
|
Schema::table('media', function (Blueprint $table) {
|
||||||
$table->dropColumn('blurhash');
|
$table->dropColumn(['blurhash','srcset','width','height']);
|
||||||
$table->dropColumn('srcset');
|
|
||||||
$table->dropColumn('width');
|
|
||||||
$table->dropColumn('height');
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,31 +6,29 @@ use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddTypeToDirectMessagesTable extends Migration
|
class AddTypeToDirectMessagesTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('direct_messages', function (Blueprint $table) {
|
Schema::table('direct_messages', function (Blueprint $table) {
|
||||||
$table->string('type')->default('text')->nullable()->index()->after('from_id');
|
$table->string('type')->default('text')->nullable()->index()->after('from_id');
|
||||||
$table->boolean('is_hidden')->default(false)->index()->after('group_message');
|
$table->boolean('is_hidden')->default(false)->index()->after('group_message');
|
||||||
$table->json('meta')->nullable()->after('is_hidden');
|
$table->json('meta')->nullable()->after('is_hidden');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('direct_messages', function (Blueprint $table) {
|
Schema::table('direct_messages', function (Blueprint $table) {
|
||||||
$table->dropColumn('type');
|
$table->dropColumn(['type','is_hidden','meta']);
|
||||||
$table->dropColumn('is_hidden');
|
});
|
||||||
$table->dropColumn('meta');
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,31 +6,30 @@ use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddStatusProfileIdToLikesTable extends Migration
|
class AddStatusProfileIdToLikesTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('likes', function (Blueprint $table) {
|
Schema::table('likes', function (Blueprint $table) {
|
||||||
$table->bigInteger('status_profile_id')->nullable()->unsigned()->index()->after('status_id');
|
$table->bigInteger('status_profile_id')->nullable()->unsigned()->index()->after('status_id');
|
||||||
$table->boolean('is_comment')->nullable()->index()->after('status_profile_id');
|
$table->boolean('is_comment')->nullable()->index()->after('status_profile_id');
|
||||||
$table->dropColumn('flagged');
|
$table->dropColumn('flagged');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('likes', function (Blueprint $table) {
|
Schema::table('likes', function (Blueprint $table) {
|
||||||
$table->dropColumn('status_profile_id');
|
$table->dropColumn(['status_profile_id','is_comment']);
|
||||||
$table->dropColumn('is_comment');
|
$table->boolean('flagged')->default(false);
|
||||||
$table->boolean('flagged')->default(false);
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,29 +6,28 @@ use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddSkipOptimizeToMediaTable extends Migration
|
class AddSkipOptimizeToMediaTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('media', function (Blueprint $table) {
|
Schema::table('media', function (Blueprint $table) {
|
||||||
$table->boolean('skip_optimize')->nullable()->index();
|
$table->boolean('skip_optimize')->nullable()->index();
|
||||||
$table->timestamp('replicated_at')->nullable();
|
$table->timestamp('replicated_at')->nullable();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('media', function (Blueprint $table) {
|
Schema::table('media', function (Blueprint $table) {
|
||||||
$table->dropColumn('skip_optimize');
|
$table->dropColumn(['skip_optimize','replicated_at']);
|
||||||
$table->dropColumn('replicated_at');
|
});
|
||||||
});
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,33 +6,31 @@ use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
class AddCdnUrlToAvatarsTable extends Migration
|
class AddCdnUrlToAvatarsTable extends Migration
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('avatars', function (Blueprint $table) {
|
Schema::table('avatars', function (Blueprint $table) {
|
||||||
$table->string('cdn_url')->unique()->index()->nullable()->after('remote_url');
|
$table->string('cdn_url')->unique()->index()->nullable()->after('remote_url');
|
||||||
$table->unsignedInteger('size')->nullable()->after('cdn_url');
|
$table->unsignedInteger('size')->nullable()->after('cdn_url');
|
||||||
$table->boolean('is_remote')->nullable()->index()->after('cdn_url');
|
$table->boolean('is_remote')->nullable()->index()->after('cdn_url');
|
||||||
$table->dropColumn('thumb_path');
|
$table->dropColumn('thumb_path');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reverse the migrations.
|
* Reverse the migrations.
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('avatars', function (Blueprint $table) {
|
Schema::table('avatars', function (Blueprint $table) {
|
||||||
$table->dropColumn('cdn_url');
|
$table->dropColumn(['cdn_url','size','is_remote']);
|
||||||
$table->dropColumn('size');
|
$table->string('thumb_path')->nullable();
|
||||||
$table->dropColumn('is_remote');
|
});
|
||||||
$table->string('thumb_path')->nullable();
|
}
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
BIN
public/js/network-timeline.js
vendored
BIN
public/js/network-timeline.js
vendored
Binary file not shown.
BIN
public/js/timeline.js
vendored
BIN
public/js/timeline.js
vendored
Binary file not shown.
Binary file not shown.
|
@ -2,12 +2,12 @@
|
||||||
<div>
|
<div>
|
||||||
<transition name="fade">
|
<transition name="fade">
|
||||||
<div class="card notification-card shadow-none border">
|
<div class="card notification-card shadow-none border">
|
||||||
<div class="card-body loader text-center" style="height: 200px;">
|
<div v-if="loading" class="card-body loader text-center" style="height: 240px;">
|
||||||
<div class="spinner-border" role="status">
|
<div class="spinner-border" role="status">
|
||||||
<span class="sr-only">Loading...</span>
|
<span class="sr-only">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="notifications.length > 0" class="card-body px-0 py-0 contents" style="max-height: 240px; overflow-y: scroll;">
|
<div v-if="!loading && notifications.length > 0" class="card-body px-0 py-0 contents" style="height: 240px; overflow-y: scroll;">
|
||||||
<div v-if="profile.locked" class="media align-items-center mt-n2 px-3 py-2 border-bottom border-lighter bg-light cursor-pointer" @click="redirect('/account/follow-requests')">
|
<div v-if="profile.locked" class="media align-items-center mt-n2 px-3 py-2 border-bottom border-lighter bg-light cursor-pointer" @click="redirect('/account/follow-requests')">
|
||||||
<div class="media-body font-weight-light pt-2 small d-flex align-items-center justify-content-between">
|
<div class="media-body font-weight-light pt-2 small d-flex align-items-center justify-content-between">
|
||||||
<p class="mb-0 text-lighter"><i class="fas fa-cog text-light"></i></p>
|
<p class="mb-0 text-lighter"><i class="fas fa-cog text-light"></i></p>
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
<p class="mb-0 small font-weight-bold">0 Notifications!</p>
|
<p class="mb-0 small font-weight-bold">0 Notifications!</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else class="card-body px-0 py-0" style="max-height: 240px;">
|
<div v-if="!loading && !notifications.length" class="card-body px-0 py-0" style="height: 240px;">
|
||||||
<div class="text-lighter text-center py-3">
|
<div class="text-lighter text-center py-3">
|
||||||
<p class="mb-0"><i class="fas fa-inbox fa-3x"></i></p>
|
<p class="mb-0"><i class="fas fa-inbox fa-3x"></i></p>
|
||||||
<p class="mb-0 small font-weight-bold">No notifications yet</p>
|
<p class="mb-0 small font-weight-bold">No notifications yet</p>
|
||||||
|
@ -103,6 +103,7 @@
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
loading: true,
|
||||||
notifications: {},
|
notifications: {},
|
||||||
notificationCursor: 2,
|
notificationCursor: 2,
|
||||||
notificationMaxId: 0,
|
notificationMaxId: 0,
|
||||||
|
@ -133,8 +134,7 @@
|
||||||
let ids = res.data.map(n => n.id);
|
let ids = res.data.map(n => n.id);
|
||||||
this.notificationMaxId = Math.min(...ids);
|
this.notificationMaxId = Math.min(...ids);
|
||||||
this.notifications = data;
|
this.notifications = data;
|
||||||
$('.notification-card .loader').addClass('d-none');
|
this.loading = false;
|
||||||
$('.notification-card .contents').removeClass('d-none');
|
|
||||||
//this.notificationPoll();
|
//this.notificationPoll();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -34,7 +34,8 @@
|
||||||
<span class="sr-only">Loading...</span>
|
<span class="sr-only">Loading...</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div :data-status-id="status.id" v-for="(status, index) in feed" :key="`${index}-${status.id}`">
|
|
||||||
|
<div :data-status-id="status.id" v-for="(status, index) in feed" :key="`feed-${index}-${status.id}`">
|
||||||
<div v-if="index == 0 && showTips && !loading" class="my-4 card-tips">
|
<div v-if="index == 0 && showTips && !loading" class="my-4 card-tips">
|
||||||
<announcements-card v-on:show-tips="showTips = $event"></announcements-card>
|
<announcements-card v-on:show-tips="showTips = $event"></announcements-card>
|
||||||
</div>
|
</div>
|
||||||
|
@ -118,7 +119,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div :class="index == 0 ? 'card mb-sm-4 status-card card-md-rounded-0 shadow-none border mt-md-4' : 'card mb-sm-4 status-card card-md-rounded-0 shadow-none border'">
|
<div :class="index == 0 ? 'card rounded-0 status-card card-md-rounded-0 shadow-none border mt-md-4' : 'card rounded-0 border-top-0 status-card card-md-rounded-0 shadow-none border'">
|
||||||
<div v-if="status" class="card-header d-inline-flex align-items-center bg-white">
|
<div v-if="status" class="card-header d-inline-flex align-items-center bg-white">
|
||||||
<!-- <img v-bind:src="status.account.avatar" width="38px" height="38px" class="cursor-pointer" style="border-radius: 38px;" @click="profileUrl(status)" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'"> -->
|
<!-- <img v-bind:src="status.account.avatar" width="38px" height="38px" class="cursor-pointer" style="border-radius: 38px;" @click="profileUrl(status)" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'"> -->
|
||||||
<!-- <div v-if="hasStory" class="has-story has-story-sm cursor-pointer shadow-sm" @click="profileUrl(status)">
|
<!-- <div v-if="hasStory" class="has-story has-story-sm cursor-pointer shadow-sm" @click="profileUrl(status)">
|
||||||
|
@ -280,26 +281,299 @@
|
||||||
</div>-->
|
</div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="!loading && feed.length">
|
<div v-if="!loading && feed.length">
|
||||||
<div class="card shadow-none">
|
<div class="card rounded-0 border-top-0 status-card card-md-rounded-0 shadow-none border">
|
||||||
<div class="card-body">
|
<div class="card-body py-5 my-5">
|
||||||
<infinite-loading @infinite="infiniteTimeline" :distance="800">
|
<infinite-loading @infinite="infiniteTimeline" :distance="800">
|
||||||
<div slot="no-more" class="font-weight-bold">No more posts to load</div>
|
<div slot="no-more">
|
||||||
<div slot="no-results" class="font-weight-bold">No more posts to load</div>
|
<div v-if="recentFeed">
|
||||||
|
<p class="text-center"><i class="far fa-check-circle fa-8x text-lighter"></i></p>
|
||||||
|
<p class="text-center h3 font-weight-light">You're All Caught Up!</p>
|
||||||
|
<p class="text-center text-muted font-weight-light">You've seen all the new posts from the accounts you follow.</p>
|
||||||
|
<p class="text-center mb-0">
|
||||||
|
<a class="btn btn-link font-weight-bold px-4" href="/?a=vop">View Older Posts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p class="text-center h3 font-weight-light">You've reached the end of this feed</p>
|
||||||
|
<p class="text-center mb-0">
|
||||||
|
<a class="btn btn-link font-weight-bold px-4" href="/discover">Discover new posts and people</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div slot="no-results">
|
||||||
|
<div v-if="recentFeed">
|
||||||
|
<p class="text-center"><i class="far fa-check-circle fa-8x text-lighter"></i></p>
|
||||||
|
<p class="text-center h3 font-weight-light">You're All Caught Up!</p>
|
||||||
|
<p class="text-center text-muted font-weight-light">You've seen all the new posts from the accounts you follow.</p>
|
||||||
|
<p class="text-center mb-0">
|
||||||
|
<a class="btn btn-link font-weight-bold px-4" href="/?a=vop">View Older Posts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div v-else>
|
||||||
|
<p class="text-center h3 font-weight-light">You've reached the end of this feed</p>
|
||||||
|
<p class="text-center mb-0">
|
||||||
|
<a class="btn btn-link font-weight-bold px-4" href="/discover">Discover new posts and people</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</infinite-loading>
|
</infinite-loading>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!loading && scope == 'home' && feed.length == 0">
|
<div v-if="!loading && scope == 'home' && feed.length == 0">
|
||||||
<div class="card shadow-none border">
|
<div class="card rounded-0 mt-4 status-card card-md-rounded-0 shadow-none border">
|
||||||
<div class="card-body text-center">
|
<div v-if="profile.following_count != '0'" class="card-body py-5 my-5">
|
||||||
<p class="h2 font-weight-lighter p-5">Hello, {{profile.acct}}</p>
|
<p class="text-center"><i class="far fa-check-circle fa-8x text-lighter"></i></p>
|
||||||
<p class="text-lighter"><i class="fas fa-camera-retro fa-5x"></i></p>
|
<p class="text-center h3 font-weight-light">You're All Caught Up!</p>
|
||||||
<p class="h3 font-weight-lighter p-5">Start following people to build your timeline.</p>
|
<p class="text-center text-muted font-weight-light">You've seen all the new posts from the accounts you follow.</p>
|
||||||
<p><a href="/discover" class="btn btn-primary font-weight-bold py-0">Discover new people and posts</a></p>
|
<p class="text-center mb-0">
|
||||||
|
<a class="btn btn-link font-weight-bold px-4" href="/?a=vop">View Older Posts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div v-else class="card-body py-5 my-5">
|
||||||
|
<p class="text-center"><i class="far fa-smile fa-8x text-lighter"></i></p>
|
||||||
|
<p class="text-center h3 font-weight-light">Hello {{profile.username}}</p>
|
||||||
|
<p class="text-center text-muted font-weight-light">Accounts you follow will appear in this feed.</p>
|
||||||
|
<p class="text-center mb-0">
|
||||||
|
<a class="btn btn-link font-weight-bold px-4" href="/discover">Discover new posts and people</a>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div v-if="!loading && scope == 'home' && recentFeed && discover_feed.length" class="pt-3">
|
||||||
|
<p class="h5 font-weight-bold pt-3 mb-0 d-flex justify-content-between align-items-center">
|
||||||
|
<span>Suggested Posts</span>
|
||||||
|
<a href="/?a=vop" class="small font-weight-bold">Older Posts</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-if="!loading && scope == 'home' && recentFeed && discover_feed.length"
|
||||||
|
:data-status-id="status.id"
|
||||||
|
v-for="(status, index) in discover_feed"
|
||||||
|
:key="`discover_feed-${index}-${status.id}`">
|
||||||
|
|
||||||
|
<div v-if="index == 2 && showSuggestions == true && suggestions.length" class="card mb-sm-4 status-card card-md-rounded-0 shadow-none border">
|
||||||
|
<div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
|
||||||
|
<h6 class="text-muted font-weight-bold mb-0">Suggestions For You</h6>
|
||||||
|
<span class="cursor-pointer text-muted" v-on:click="hideSuggestions"><i class="fas fa-times"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body row mx-0">
|
||||||
|
<div class="col-12 col-md-4 mb-3" v-for="(rec, index) in suggestions">
|
||||||
|
<div class="card">
|
||||||
|
<div class="card-body text-center pt-3">
|
||||||
|
<p class="mb-0">
|
||||||
|
<a :href="'/'+rec.username">
|
||||||
|
<img :src="rec.avatar" class="img-fluid rounded-circle cursor-pointer" width="45px" height="45px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'" alt="avatar">
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<div class="py-3">
|
||||||
|
<p class="font-weight-bold text-dark cursor-pointer mb-0">
|
||||||
|
<a :href="'/'+rec.username" class="text-decoration-none text-dark">
|
||||||
|
{{rec.username}}
|
||||||
|
</a>
|
||||||
|
</p>
|
||||||
|
<p class="small text-muted mb-0">{{rec.message}}</p>
|
||||||
|
</div>
|
||||||
|
<p class="mb-0">
|
||||||
|
<a class="btn btn-primary btn-block font-weight-bold py-0" href="#" @click.prevent="expRecFollow(rec.id, index)">Follow</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="index == 4 && showHashtagPosts && hashtagPosts.length" class="card status-card rounded-0 shadow-none border-top-0 border">
|
||||||
|
<div class="card-header d-flex align-items-center justify-content-between bg-white border-0 pb-0">
|
||||||
|
<span></span>
|
||||||
|
<h6 class="text-muted font-weight-bold mb-0"><a :href="'/discover/tags/'+hashtagPostsName+'?src=tr'">#{{hashtagPostsName}}</a></h6>
|
||||||
|
<span class="cursor-pointer text-muted" v-on:click="showHashtagPosts = false"><i class="fas fa-times"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="card-body row mx-0">
|
||||||
|
<div v-for="(tag, index) in hashtagPosts" class="col-4 p-0 p-sm-2 p-md-3 hashtag-post-square">
|
||||||
|
<a class="card info-overlay card-md-border-0" :href="tag.status.url">
|
||||||
|
<div :class="[tag.status.filter ? 'square ' + tag.status.filter : 'square']">
|
||||||
|
<div v-if="tag.status.sensitive" class="square-content">
|
||||||
|
<div class="info-overlay-text-label">
|
||||||
|
<h5 class="text-white m-auto font-weight-bold">
|
||||||
|
<span>
|
||||||
|
<span class="far fa-eye-slash fa-lg p-2 d-flex-inline"></span>
|
||||||
|
</span>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
<blur-hash-canvas
|
||||||
|
width="32"
|
||||||
|
height="32"
|
||||||
|
:hash="tag.status.media_attachments[0].blurhash"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div v-else class="square-content">
|
||||||
|
<blur-hash-image
|
||||||
|
width="32"
|
||||||
|
height="32"
|
||||||
|
:hash="tag.status.media_attachments[0].blurhash"
|
||||||
|
:src="tag.status.media_attachments[0].preview_url"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div class="info-overlay-text">
|
||||||
|
<h5 class="text-white m-auto font-weight-bold">
|
||||||
|
<span class="pr-4">
|
||||||
|
<span class="far fa-heart fa-lg pr-1"></span> {{formatCount(tag.status.favourites_count)}}
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<span class="far fa-comment fa-lg pr-1"></span> {{formatCount(tag.status.reply_count)}}
|
||||||
|
</span>
|
||||||
|
</h5>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div :class="index == 0 ? 'card rounded-0 status-card card-md-rounded-0 shadow-none border mt-md-4' : 'card rounded-0 border-top-0 status-card card-md-rounded-0 shadow-none border'">
|
||||||
|
<div v-if="status" class="card-header d-inline-flex align-items-center bg-white">
|
||||||
|
<!-- <img v-bind:src="status.account.avatar" width="38px" height="38px" class="cursor-pointer" style="border-radius: 38px;" @click="profileUrl(status)" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'"> -->
|
||||||
|
<!-- <div v-if="hasStory" class="has-story has-story-sm cursor-pointer shadow-sm" @click="profileUrl(status)">
|
||||||
|
<img class="rounded-circle box-shadow" :src="status.account.avatar" width="32px" height="32px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'">
|
||||||
|
</div>
|
||||||
|
<div v-else> -->
|
||||||
|
<div>
|
||||||
|
<img class="rounded-circle box-shadow" :src="status.account.avatar" width="32px" height="32px" onerror="this.onerror=null;this.src='/storage/avatars/default.png?v=2'" alt="avatar">
|
||||||
|
</div>
|
||||||
|
<div class="pl-2">
|
||||||
|
<!-- <a class="d-block username font-weight-bold text-dark" v-bind:href="status.account.url" style="line-height:0.5;"> -->
|
||||||
|
<a class="username font-weight-bold text-dark text-decoration-none text-break" v-bind:href="profileUrl(status)" v-html="statusCardUsernameFormat(status)">
|
||||||
|
Loading...
|
||||||
|
</a>
|
||||||
|
<span v-if="status.account.is_admin" class="fa-stack" title="Admin Account" data-toggle="tooltip" style="height:1em; line-height:1em; max-width:19px;">
|
||||||
|
<i class="fas fa-certificate text-danger fa-stack-1x"></i>
|
||||||
|
<i class="fas fa-crown text-white fa-sm fa-stack-1x" style="font-size:7px;"></i>
|
||||||
|
</span>
|
||||||
|
<!-- <span v-if="scope != 'home' && status.account.id != profile.id && status.account.relationship">
|
||||||
|
<span class="px-1">•</span>
|
||||||
|
<span :class="'font-weight-bold cursor-pointer ' + [status.account.relationship.following == true ? 'text-muted' : 'text-primary']" @click="followAction(status)">{{status.account.relationship.following == true ? 'Following' : 'Follow'}}</span>
|
||||||
|
</span> -->
|
||||||
|
<!-- <span v-if="status.account.id != profile.id">
|
||||||
|
<span class="px-1">•</span>
|
||||||
|
<span class="font-weight-bold cursor-pointer text-primary">Follow</span>
|
||||||
|
</span> -->
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<a v-if="status.place" class="small text-decoration-none text-muted" :href="'/discover/places/'+status.place.id+'/'+status.place.slug" title="Location" data-toggle="tooltip"><i class="fas fa-map-marked-alt"></i> {{status.place.name}}, {{status.place.country}}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="text-right" style="flex-grow:1;">
|
||||||
|
<button class="btn btn-link text-dark py-0" type="button" @click="ctxMenu(status)">
|
||||||
|
<span class="fas fa-ellipsis-h text-lighter"></span>
|
||||||
|
<span class="sr-only">Post Menu</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="postPresenterContainer cursor-pointer" style="background: #000;" @click="redirect(statusUrl(status))">
|
||||||
|
|
||||||
|
<div v-if="config.ab.top && status.pf_type === 'text'" class="w-100">
|
||||||
|
<div class="w-100 card-img-top border-bottom rounded-0" style="background-image: url(/storage/textimg/bg_1.jpg);background-size: cover;width: 100%;height: 540px;">
|
||||||
|
<div class="w-100 h-100 d-flex justify-content-center align-items-center">
|
||||||
|
<p class="text-center text-break h3 px-5 font-weight-bold" v-html="status.content"></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="status.pf_type === 'photo'" class="w-100">
|
||||||
|
<photo-presenter :status="status" v-on:lightbox="lightbox" v-on:togglecw="status.sensitive = false"></photo-presenter>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="status.pf_type === 'video'" class="w-100">
|
||||||
|
<video-presenter :status="status"></video-presenter>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="status.pf_type === 'photo:album'" class="w-100">
|
||||||
|
<photo-album-presenter :status="status" v-on:lightbox="lightbox"></photo-album-presenter>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="status.pf_type === 'video:album'" class="w-100">
|
||||||
|
<video-album-presenter :status="status"></video-album-presenter>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else-if="status.pf_type === 'photo:video:album'" class="w-100">
|
||||||
|
<mixed-album-presenter :status="status" v-on:lightbox="lightbox"></mixed-album-presenter>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-else class="w-100">
|
||||||
|
<p class="text-center p-0 font-weight-bold text-white">Error: Problem rendering preview.</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="config.features.label.covid.enabled && status.label && status.label.covid == true" class="card-body border-top border-bottom py-2 cursor-pointer pr-2" @click="labelRedirect()">
|
||||||
|
<p class="font-weight-bold d-flex justify-content-between align-items-center mb-0">
|
||||||
|
<span>
|
||||||
|
<i class="fas fa-info-circle mr-2"></i>
|
||||||
|
For information about COVID-19, {{config.features.label.covid.org}}
|
||||||
|
</span>
|
||||||
|
<span>
|
||||||
|
<i class="fas fa-chevron-right text-lighter"></i>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="card-body">
|
||||||
|
<div v-if="status.pf_type != 'text'" class="caption">
|
||||||
|
<p v-if="!status.sensitive" class="mb-2 read-more" style="overflow: hidden;">
|
||||||
|
<span class="username font-weight-bold">
|
||||||
|
<bdi><a class="text-dark" :href="profileUrl(status)">{{status.account.username}}</a></bdi>
|
||||||
|
</span>
|
||||||
|
<span class="status-content" v-html="status.content"></span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="comments" v-if="status.id == replyId && !status.comments_disabled">
|
||||||
|
<p class="mb-0 d-flex justify-content-between align-items-top read-more mt-2" style="overflow-y: hidden;" v-for="(reply, index) in replies">
|
||||||
|
<span>
|
||||||
|
<a class="text-dark font-weight-bold mr-1" :href="profileUrl(reply)">{{reply.account.username}}</a>
|
||||||
|
<span v-html="reply.content" style="word-break: break-all;" class="comment-body"></span>
|
||||||
|
</span>
|
||||||
|
<span class="mb-0" style="min-width:38px">
|
||||||
|
<span v-on:click="likeStatus(reply, $event);">
|
||||||
|
<i v-bind:class="[reply.favourited ? 'fas fa-heart fa-sm text-danger cursor-pointer':'far fa-heart fa-sm text-lighter cursor-pointer']"></i>
|
||||||
|
</span>
|
||||||
|
<!-- <post-menu :status="reply" :profile="profile" size="sm" :modal="'true'" :feed="feed" class="d-inline-flex pl-2"></post-menu> - ->
|
||||||
|
<span class="text-lighter pl-2 cursor-pointer" @click="ctxMenu(reply)">
|
||||||
|
<span class="fas fa-ellipsis-v text-lighter"></span>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
</p>
|
||||||
|
</div> -->
|
||||||
|
<div class="timestamp mt-2">
|
||||||
|
<p class="small mb-0">
|
||||||
|
<a :href="statusUrl(status)" class="text-muted text-uppercase">
|
||||||
|
<timeago :datetime="status.created_at" :auto-update="60" :converter-options="{includeSeconds:true}" :title="timestampFormat(status.created_at)" v-b-tooltip.hover.bottom></timeago>
|
||||||
|
</a>
|
||||||
|
<span class="px-1">·</span>
|
||||||
|
<span class="text-muted">Based on popular and trending content</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!--<div v-if="status.id == replyId && !status.comments_disabled" class="card-footer bg-white px-2 py-0">
|
||||||
|
<ul class="nav align-items-center emoji-reactions" style="overflow-x: scroll;flex-wrap: unset;">
|
||||||
|
<li class="nav-item" v-on:click="emojiReaction(status)" v-for="e in emoji">{{e}}</li>
|
||||||
|
</ul>
|
||||||
|
</div>-->
|
||||||
|
|
||||||
|
<!--<div v-if="status.id == replyId && !status.comments_disabled" class="card-footer bg-white sticky-md-bottom p-0">
|
||||||
|
<form class="border-0 rounded-0 align-middle" method="post" action="/i/comment" :data-id="status.id" data-truncate="false">
|
||||||
|
<textarea class="form-control border-0 rounded-0" name="comment" placeholder="Add a comment…" autocomplete="off" autocorrect="off" style="height:56px;line-height: 18px;max-height:80px;resize: none; padding-right:4.2rem;" v-model="replyText"></textarea>
|
||||||
|
<input type="button" value="Post" class="d-inline-block btn btn-link font-weight-bold reply-btn text-decoration-none" v-on:click.prevent="commentSubmit(status, $event)" :disabled="replyText.length == 0" />
|
||||||
|
</form>
|
||||||
|
</div>-->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4 col-lg-4 my-4 order-1 order-md-2 d-none d-md-block">
|
<div class="col-md-4 col-lg-4 my-4 order-1 order-md-2 d-none d-md-block">
|
||||||
|
@ -916,7 +1190,10 @@
|
||||||
},
|
},
|
||||||
discover_min_id: 0,
|
discover_min_id: 0,
|
||||||
discover_max_id: 0,
|
discover_max_id: 0,
|
||||||
discover_feed: []
|
discover_feed: [],
|
||||||
|
recentFeed: this.scope === 'home' ? true : false,
|
||||||
|
recentFeedMin: null,
|
||||||
|
recentFeedMax: null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -946,6 +1223,19 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
|
let u = new URLSearchParams(window.location.search);
|
||||||
|
if(u.has('a')) {
|
||||||
|
switch(u.get('a')) {
|
||||||
|
case 'recent_feed':
|
||||||
|
if(this.scope === 'home') {
|
||||||
|
this.recentFeed = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'vop':
|
||||||
|
this.recentFeed = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
this.fetchProfile();
|
this.fetchProfile();
|
||||||
this.fetchTimelineApi();
|
this.fetchTimelineApi();
|
||||||
},
|
},
|
||||||
|
@ -979,8 +1269,12 @@
|
||||||
this.$nextTick(function () {
|
this.$nextTick(function () {
|
||||||
$('[data-toggle="tooltip"]').tooltip();
|
$('[data-toggle="tooltip"]').tooltip();
|
||||||
let u = new URLSearchParams(window.location.search);
|
let u = new URLSearchParams(window.location.search);
|
||||||
if(u.has('a') && u.get('a') == 'co') {
|
if(u.has('a')) {
|
||||||
$('#composeModal').modal('show');
|
switch(u.get('a')) {
|
||||||
|
case 'co':
|
||||||
|
$('#composeModal').modal('show');
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -1029,7 +1323,8 @@
|
||||||
axios.get(apiUrl, {
|
axios.get(apiUrl, {
|
||||||
params: {
|
params: {
|
||||||
max_id: this.max_id,
|
max_id: this.max_id,
|
||||||
limit: 3
|
limit: 3,
|
||||||
|
recent_feed: this.recentFeed
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
|
@ -1040,9 +1335,7 @@
|
||||||
this.max_id = Math.min(...ids).toString();
|
this.max_id = Math.min(...ids).toString();
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
$('.timeline .pagination').removeClass('d-none');
|
$('.timeline .pagination').removeClass('d-none');
|
||||||
// if(this.feed.length == 4) {
|
|
||||||
// this.fetchTimelineApi();
|
|
||||||
// }
|
|
||||||
if(this.hashtagPosts.length == 0) {
|
if(this.hashtagPosts.length == 0) {
|
||||||
this.fetchHashtagPosts();
|
this.fetchHashtagPosts();
|
||||||
}
|
}
|
||||||
|
@ -1053,6 +1346,16 @@
|
||||||
i.href = App.util.format.rewriteLinks(i);
|
i.href = App.util.format.rewriteLinks(i);
|
||||||
});
|
});
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
|
axios.get('/api/pixelfed/v2/discover/posts/trending', {
|
||||||
|
params: {
|
||||||
|
range: 'daily'
|
||||||
|
}
|
||||||
|
}).then(res => {
|
||||||
|
let data = res.data.filter(post => this.ids.indexOf(post.id) === -1);
|
||||||
|
this.discover_feed = data;
|
||||||
|
});
|
||||||
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal(
|
swal(
|
||||||
'Oops, something went wrong',
|
'Oops, something went wrong',
|
||||||
|
@ -1071,7 +1374,9 @@
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
$state.complete();
|
$state.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
let apiUrl = false;
|
let apiUrl = false;
|
||||||
|
|
||||||
switch(this.scope) {
|
switch(this.scope) {
|
||||||
case 'home':
|
case 'home':
|
||||||
apiUrl = '/api/pixelfed/v1/timelines/home';
|
apiUrl = '/api/pixelfed/v1/timelines/home';
|
||||||
|
@ -1085,16 +1390,23 @@
|
||||||
apiUrl = '/api/pixelfed/v1/timelines/network';
|
apiUrl = '/api/pixelfed/v1/timelines/network';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
axios.get(apiUrl, {
|
axios.get(apiUrl, {
|
||||||
params: {
|
params: {
|
||||||
max_id: this.max_id,
|
max_id: this.max_id,
|
||||||
limit: 6
|
limit: 6,
|
||||||
|
recent_feed: this.recentFeed
|
||||||
},
|
},
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.data.length && this.loading == false) {
|
if (res.data.length && this.loading == false) {
|
||||||
let data = res.data;
|
let data = res.data;
|
||||||
let self = this;
|
let self = this;
|
||||||
let vids = [];
|
let vids = [];
|
||||||
|
if(self.recentFeed && self.ids.indexOf(data[0].id) != -1) {
|
||||||
|
this.loading = false;
|
||||||
|
$state.complete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
data.forEach((d, index) => {
|
data.forEach((d, index) => {
|
||||||
if(self.ids.indexOf(d.id) == -1) {
|
if(self.ids.indexOf(d.id) == -1) {
|
||||||
self.feed.push(d);
|
self.feed.push(d);
|
||||||
|
@ -1936,7 +2248,8 @@
|
||||||
axios.get(apiUrl, {
|
axios.get(apiUrl, {
|
||||||
params: {
|
params: {
|
||||||
max_id: 0,
|
max_id: 0,
|
||||||
limit: 20
|
limit: 20,
|
||||||
|
recent_feed: this.recentFeed
|
||||||
}
|
}
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
let self = this;
|
let self = this;
|
||||||
|
|
Loading…
Reference in a new issue