Merge pull request #2776 from pixelfed/staging

v0.11.0
This commit is contained in:
daniel 2021-06-01 23:54:19 -06:00 committed by GitHub
commit a34fe00114
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 779 additions and 508 deletions

View file

@ -1,6 +1,8 @@
# 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
- Autocomplete Support (hashtags + mentions) ([de514f7d](https://github.com/pixelfed/pixelfed/commit/de514f7d))
- 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))
- Fresh about page layout ([92dc7af6](https://github.com/pixelfed/pixelfed/commit/92dc7af6))
- Instance Rules ([a4efbb75](https://github.com/pixelfed/pixelfed/commit/a4efbb75))
- New Home Timeline ([56215be7](https://github.com/pixelfed/pixelfed/commit/56215be7))
### Updated
- 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 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))
- ([](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)
### Added

View file

@ -5,6 +5,7 @@ namespace App\Exceptions;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Throwable;
use League\OAuth2\Server\Exception\OAuthServerException;
use Zttp\ConnectionException;
class Handler extends ExceptionHandler
{
@ -14,7 +15,8 @@ class Handler extends ExceptionHandler
* @var array
*/
protected $dontReport = [
OAuthServerException::class
OAuthServerException::class,
ConnectionException::class
];
/**

View file

@ -596,6 +596,10 @@ class DirectMessageController extends Controller
$q = $request->input('q');
$r = $request->input('remote');
if(!Str::of($q)->contains('.')) {
return [];
}
if($r && Helpers::validateUrl($q)) {
Helpers::profileFetch($q);
}

View file

@ -12,6 +12,7 @@ use App\{
Profile,
StatusHashtag,
Status,
StatusView,
UserFilter
};
use Auth,Cache;
@ -376,9 +377,13 @@ class PublicApiController extends Controller
'page' => 'nullable|integer|max:40',
'min_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');
$min = $request->input('min_id');
$max = $request->input('max_id');
@ -393,29 +398,21 @@ class PublicApiController extends Controller
return;
});
// TODO: Use redis for timelines
// $timeline = Timeline::build()->local();
$pid = Auth::user()->profile->id;
$pid = Auth::user()->profile_id;
$following = Cache::remember('profile:following:'.$pid, now()->addMinutes(1440), function() use($pid) {
$following = Follower::whereProfileId($pid)->pluck('following_id');
return $following->push($pid)->toArray();
});
// $private = Cache::remember('profiles:private', now()->addMinutes(1440), function() {
// return Profile::whereIsPrivate(true)
// ->orWhere('unlisted', true)
// ->orWhere('status', '!=', null)
// ->pluck('id');
// });
// $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);
if($recentFeed == true) {
$key = 'profile:home-timeline-cursor:'.$user->id;
$ttl = now()->addMinutes(30);
$min = Cache::remember($key, $ttl, function() use($pid) {
$res = StatusView::whereProfileId($pid)->orderByDesc('status_id')->first();
return $res ? $res->status_id : null;
});
}
$filtered = Auth::check() ? UserFilterService::filters(Auth::user()->profile_id) : [];

View file

@ -14,7 +14,7 @@ use App\StatusView;
use App\Transformer\ActivityPub\StatusTransformer;
use App\Transformer\ActivityPub\Verb\Note;
use App\User;
use Auth, Cache;
use Auth, DB, Cache;
use Illuminate\Http\Request;
use League\Fractal;
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->type === 'video' &&
// $request->has('video_beta') &&
// $request->video_beta == 1 &&
// $request->user() ?
// 'status.show_video' : 'status.show';
return view($template, compact('user', 'status'));
}
@ -403,27 +397,27 @@ class StatusController extends Controller
public function storeView(Request $request)
{
abort_if(!$request->user(), 403);
$this->validate($request, [
'_v' => 'required|array'
]);
$views = $request->input('_v');
$uid = $request->user()->profile_id;
if(empty($views)) {
return;
if(empty($views) || !is_array($views)) {
return response()->json(0);
}
Cache::forget('profile:home-timeline-cursor:' . $request->user()->id);
foreach($views as $view) {
if(!isset($view['sid']) || !isset($view['pid'])) {
continue;
}
StatusView::firstOrCreate([
'status_id' => $view['sid'],
'status_profile_id' => $view['pid'],
'profile_id' => $uid
]);
DB::transaction(function () use($view, $uid) {
StatusView::firstOrCreate([
'status_id' => $view['sid'],
'status_profile_id' => $view['pid'],
'profile_id' => $uid
]);
});
}
return response()->json(1);

View file

@ -154,13 +154,13 @@ class Inbox
$this->handleDirectMessage();
return;
}
if(!$this->verifyNoteAttachment()) {
return;
}
if($activity['type'] == 'Note' && !empty($activity['inReplyTo'])) {
$this->handleNoteReply();
} elseif($activity['type'] == 'Note' && !empty($activity['attachment'])) {
if(!$this->verifyNoteAttachment()) {
return;
}
$this->handleNoteCreate();
}
}

View file

@ -4,7 +4,7 @@ namespace App\Util\Lexer;
class PrettyNumber
{
public static function convert($number)
public static function convert($number, $showDecimals = true)
{
if(!is_integer($number)) {
return $number;
@ -14,7 +14,7 @@ class PrettyNumber
foreach ($abbrevs as $exponent => $abbrev) {
if(abs($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;
break;
}

View file

@ -108,8 +108,8 @@ return [
'cipher' => 'AES-256-CBC',
'short_description' => 'Pixelfed - Photo sharing for everyone',
'description' => 'Pixelfed - Photo sharing for everyone',
'short_description' => 'Pixelfed is an image sharing platform, an ethical alternative to centralized platforms.',
'description' => 'Pixelfed is an image sharing platform, an ethical alternative to centralized platforms.',
'rules' => null,
'logo' => '/img/pixelfed-icon-color.svg',

View file

@ -2,280 +2,280 @@
return [
/*
|--------------------------------------------------------------------------
| Domains
|--------------------------------------------------------------------------
|
| Application domains used for routing
|
*/
'domain' => [
'admin' => env('ADMIN_DOMAIN'),
'app' => env('APP_DOMAIN'),
],
/*
|--------------------------------------------------------------------------
| Domains
|--------------------------------------------------------------------------
|
| Application domains used for routing
|
*/
'domain' => [
'admin' => env('ADMIN_DOMAIN'),
'app' => env('APP_DOMAIN'),
],
/*
|--------------------------------------------------------------------------
| Pixelfed Version
|--------------------------------------------------------------------------
|
| This value is the version of your Pixelfed instance.
|
*/
'version' => '0.10.10',
/*
|--------------------------------------------------------------------------
| Pixelfed Version
|--------------------------------------------------------------------------
|
| This value is the version of your Pixelfed instance.
|
*/
'version' => '0.11.0',
/*
|--------------------------------------------------------------------------
| NodeInfo Route Path
|--------------------------------------------------------------------------
|
| Do not change this value unless you know what you are doing.
|
*/
'nodeinfo' => [
'url' => config('app.url').'/api/nodeinfo/2.0.json',
],
/*
|--------------------------------------------------------------------------
| NodeInfo Route Path
|--------------------------------------------------------------------------
|
| Do not change this value unless you know what you are doing.
|
*/
'nodeinfo' => [
'url' => config('app.url').'/api/nodeinfo/2.0.json',
],
/*
|--------------------------------------------------------------------------
| PHP/ImageMagic/GD Memory Limit
|--------------------------------------------------------------------------
|
| This memory_limit value is only used for image processing. The
| default memory_limit php.ini is used for the rest of the app.
|
*/
'memory_limit' => env('MEMORY_LIMIT', '1024M'),
/*
|--------------------------------------------------------------------------
| PHP/ImageMagic/GD Memory Limit
|--------------------------------------------------------------------------
|
| This memory_limit value is only used for image processing. The
| default memory_limit php.ini is used for the rest of the app.
|
*/
'memory_limit' => env('MEMORY_LIMIT', '1024M'),
/*
|--------------------------------------------------------------------------
| Allow New Registrations
|--------------------------------------------------------------------------
|
| Enable/disable new local account registrations.
|
*/
'open_registration' => env('OPEN_REGISTRATION', true),
/*
|--------------------------------------------------------------------------
| Allow New Registrations
|--------------------------------------------------------------------------
|
| Enable/disable new local account registrations.
|
*/
'open_registration' => env('OPEN_REGISTRATION', true),
/*
|--------------------------------------------------------------------------
| Account file size limit
|--------------------------------------------------------------------------
|
| Update the max account size, the per user limit of files in KB.
|
|
*/
'max_account_size' => env('MAX_ACCOUNT_SIZE', 1000000),
/*
|--------------------------------------------------------------------------
| Account file size limit
|--------------------------------------------------------------------------
|
| Update the max account size, the per user limit of files in KB.
|
|
*/
'max_account_size' => env('MAX_ACCOUNT_SIZE', 1000000),
/*
|--------------------------------------------------------------------------
| Photo file size limit
|--------------------------------------------------------------------------
|
| Update the max photo size, in KB.
|
*/
'max_photo_size' => env('MAX_PHOTO_SIZE', 15000),
/*
|--------------------------------------------------------------------------
| Photo file size limit
|--------------------------------------------------------------------------
|
| Update the max photo size, in KB.
|
*/
'max_photo_size' => env('MAX_PHOTO_SIZE', 15000),
/*
|--------------------------------------------------------------------------
| Avatar file size limit
|--------------------------------------------------------------------------
|
| Update the max avatar size, in KB.
|
*/
'max_avatar_size' => (int) env('MAX_AVATAR_SIZE', 2000),
/*
|--------------------------------------------------------------------------
| Avatar file size limit
|--------------------------------------------------------------------------
|
| Update the max avatar size, in KB.
|
*/
'max_avatar_size' => (int) env('MAX_AVATAR_SIZE', 2000),
/*
|--------------------------------------------------------------------------
| Caption limit
|--------------------------------------------------------------------------
|
| Change the caption length limit for new local posts.
|
*/
'max_caption_length' => env('MAX_CAPTION_LENGTH', 500),
/*
|--------------------------------------------------------------------------
| Caption limit
|--------------------------------------------------------------------------
|
| Change the caption length limit for new local posts.
|
*/
'max_caption_length' => env('MAX_CAPTION_LENGTH', 500),
/*
|--------------------------------------------------------------------------
| Bio length limit
|--------------------------------------------------------------------------
|
| Change the bio length limit for user profiles.
|
*/
'max_bio_length' => env('MAX_BIO_LENGTH', 125),
/*
|--------------------------------------------------------------------------
| Bio length limit
|--------------------------------------------------------------------------
|
| Change the bio length limit for user profiles.
|
*/
'max_bio_length' => env('MAX_BIO_LENGTH', 125),
/*
|--------------------------------------------------------------------------
| User name length limit
|--------------------------------------------------------------------------
|
| Change the length limit for user names.
|
*/
'max_name_length' => env('MAX_NAME_LENGTH', 30),
/*
|--------------------------------------------------------------------------
| User name length limit
|--------------------------------------------------------------------------
|
| Change the length limit for user names.
|
*/
'max_name_length' => env('MAX_NAME_LENGTH', 30),
/*
|--------------------------------------------------------------------------
| Password minimum length limit
|--------------------------------------------------------------------------
|
| Change the minimum length limit for user passwords.
|
*/
'min_password_length' => env('MIN_PASSWORD_LENGTH', 12),
/*
|--------------------------------------------------------------------------
| Password minimum length limit
|--------------------------------------------------------------------------
|
| Change the minimum length limit for user passwords.
|
*/
'min_password_length' => env('MIN_PASSWORD_LENGTH', 8),
/*
|--------------------------------------------------------------------------
| Album size limit
|--------------------------------------------------------------------------
|
| The max number of photos allowed per post.
|
*/
'max_album_length' => env('MAX_ALBUM_LENGTH', 4),
/*
|--------------------------------------------------------------------------
| Album size limit
|--------------------------------------------------------------------------
|
| The max number of photos allowed per post.
|
*/
'max_album_length' => env('MAX_ALBUM_LENGTH', 4),
/*
|--------------------------------------------------------------------------
| Email Verification
|--------------------------------------------------------------------------
|
| Require email verification before a new user can do anything.
|
*/
'enforce_email_verification' => env('ENFORCE_EMAIL_VERIFICATION', true),
/*
|--------------------------------------------------------------------------
| Email Verification
|--------------------------------------------------------------------------
|
| Require email verification before a new user can do anything.
|
*/
'enforce_email_verification' => env('ENFORCE_EMAIL_VERIFICATION', true),
/*
|--------------------------------------------------------------------------
| Image Quality
|--------------------------------------------------------------------------
|
| Set the image optimization quality, must be a value between 1-100.
|
*/
'image_quality' => (int) env('IMAGE_QUALITY', 80),
/*
|--------------------------------------------------------------------------
| Image Quality
|--------------------------------------------------------------------------
|
| Set the image optimization quality, must be a value between 1-100.
|
*/
'image_quality' => (int) env('IMAGE_QUALITY', 80),
/*
|--------------------------------------------------------------------------
| Account deletion
|--------------------------------------------------------------------------
|
| Enable account deletion.
|
*/
'account_deletion' => env('ACCOUNT_DELETION', true),
/*
|--------------------------------------------------------------------------
| Account deletion
|--------------------------------------------------------------------------
|
| Enable account deletion.
|
*/
'account_deletion' => env('ACCOUNT_DELETION', true),
/*
|--------------------------------------------------------------------------
| Account deletion after X days
|--------------------------------------------------------------------------
|
| Set account deletion queue after X days, set to false to delete accounts
| immediately.
|
*/
'account_delete_after' => env('ACCOUNT_DELETE_AFTER', false),
/*
|--------------------------------------------------------------------------
| Account deletion after X days
|--------------------------------------------------------------------------
|
| Set account deletion queue after X days, set to false to delete accounts
| immediately.
|
*/
'account_delete_after' => env('ACCOUNT_DELETE_AFTER', false),
/*
|--------------------------------------------------------------------------
| Enable Cloud Storage
|--------------------------------------------------------------------------
|
| Store media on object storage like S3, Digital Ocean Spaces, Rackspace
|
*/
'cloud_storage' => env('PF_ENABLE_CLOUD', false),
/*
|--------------------------------------------------------------------------
| Enable Cloud Storage
|--------------------------------------------------------------------------
|
| Store media on object storage like S3, Digital Ocean Spaces, Rackspace
|
*/
'cloud_storage' => env('PF_ENABLE_CLOUD', false),
/*
|--------------------------------------------------------------------------
| Max User Limit
|--------------------------------------------------------------------------
|
| Allow a maximum number of user accounts. Default: off
|
*/
'max_users' => env('PF_MAX_USERS', false),
/*
|--------------------------------------------------------------------------
| Max User Limit
|--------------------------------------------------------------------------
|
| Allow a maximum number of user accounts. Default: off
|
*/
'max_users' => env('PF_MAX_USERS', false),
/*
|--------------------------------------------------------------------------
| Optimize Images
|--------------------------------------------------------------------------
|
| Resize and optimize image uploads. Default: on
|
*/
'optimize_image' => env('PF_OPTIMIZE_IMAGES', true),
/*
|--------------------------------------------------------------------------
| Optimize Images
|--------------------------------------------------------------------------
|
| Resize and optimize image uploads. Default: on
|
*/
'optimize_image' => env('PF_OPTIMIZE_IMAGES', true),
/*
|--------------------------------------------------------------------------
| Optimize Videos
|--------------------------------------------------------------------------
|
| Resize and optimize video uploads. Default: on
|
*/
'optimize_video' => env('PF_OPTIMIZE_VIDEOS', true),
/*
|--------------------------------------------------------------------------
| Optimize Videos
|--------------------------------------------------------------------------
|
| Resize and optimize video uploads. Default: on
|
*/
'optimize_video' => env('PF_OPTIMIZE_VIDEOS', true),
/*
|--------------------------------------------------------------------------
| User invites
|--------------------------------------------------------------------------
|
| Allow users to invite others via email.
| Will respect max user limit and prevent invites after the
| limit is reached. Default: off
|
*/
'user_invites' => [
'enabled' => env('PF_USER_INVITES', false),
'limit' => [
'total' => (int) env('PF_USER_INVITES_TOTAL_LIMIT', 0),
'daily' => (int) env('PF_USER_INVITES_DAILY_LIMIT', 0),
'monthly' => (int) env('PF_USER_INVITES_MONTHLY_LIMIT', 0),
]
],
/*
|--------------------------------------------------------------------------
| User invites
|--------------------------------------------------------------------------
|
| Allow users to invite others via email.
| Will respect max user limit and prevent invites after the
| limit is reached. Default: off
|
*/
'user_invites' => [
'enabled' => env('PF_USER_INVITES', false),
'limit' => [
'total' => (int) env('PF_USER_INVITES_TOTAL_LIMIT', 0),
'daily' => (int) env('PF_USER_INVITES_DAILY_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' => [
'instagram' => [
'enabled' => env('IMPORT_INSTAGRAM', false),
'limits' => [
'posts' => (int) env('IMPORT_INSTAGRAM_POST_LIMIT', 100),
'size' => (int) env('IMPORT_INSTAGRAM_SIZE_LIMIT', 5000)
]
]
],
'import' => [
'instagram' => [
'enabled' => env('IMPORT_INSTAGRAM', false),
'limits' => [
'posts' => (int) env('IMPORT_INSTAGRAM_POST_LIMIT', 100),
'size' => (int) env('IMPORT_INSTAGRAM_SIZE_LIMIT', 5000)
]
]
],
'oauth_enabled' => env('OAUTH_ENABLED', false),
'oauth_enabled' => env('OAUTH_ENABLED', false),
'admin' => [
'env_editor' => env('ADMIN_ENV_EDITOR', false)
],
'admin' => [
'env_editor' => env('ADMIN_ENV_EDITOR', false)
],
'bouncer' => [
'enabled' => env('PF_BOUNCER_ENABLED', false),
],
'bouncer' => [
'enabled' => env('PF_BOUNCER_ENABLED', false),
],
/*
|--------------------------------------------------------------------------
| Media Fast Process
|--------------------------------------------------------------------------
|
| Don't require photos & video to finish optimization &
| upload to S3 if enabled before posting. If disabled
| users will have to wait until processed before posting,
| sacrificing the user experience to ensure media is federated
| using S3 urls (if enabled). Default: off
|
*/
'media_fast_process' => env('PF_MEDIA_FAST_PROCESS', true),
/*
|--------------------------------------------------------------------------
| Media Fast Process
|--------------------------------------------------------------------------
|
| Don't require photos & video to finish optimization &
| upload to S3 if enabled before posting. If disabled
| users will have to wait until processed before posting,
| sacrificing the user experience to ensure media is federated
| using S3 urls (if enabled). Default: off
|
*/
'media_fast_process' => env('PF_MEDIA_FAST_PROCESS', true),
];

View file

@ -27,8 +27,7 @@ class AddFiltersToMediaTable extends Migration
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('filter_name');
$table->dropColumn('filter_class');
$table->dropColumn(['filter_name','filter_class']);
});
}
}

View file

@ -29,10 +29,7 @@ class Add2faToUsersTable extends Migration
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('2fa_enabled');
$table->dropColumn('2fa_secret');
$table->dropColumn('2fa_backup_codes');
$table->dropColumn('2fa_setup_at');
$table->dropColumn(['2fa_enabled','2fa_secret','2fa_backup_codes','2fa_setup_at']);
});
}
}

View file

@ -29,10 +29,7 @@ class UpdateSettingsTable extends Migration
public function down()
{
Schema::table('user_settings', function (Blueprint $table) {
$table->dropColumn('show_profile_followers');
$table->dropColumn('show_profile_follower_count');
$table->dropColumn('show_profile_following');
$table->dropColumn('show_profile_following_count');
$table->dropColumn(['show_profile_followers','show_profile_follower_count','show_profile_following','show_profile_following_count']);
});
}
}

View file

@ -32,13 +32,7 @@ class UpdateMediaTableAddAltText extends Migration
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('original_sha256');
$table->dropColumn('optimized_sha256');
$table->dropColumn('caption');
$table->dropColumn('hls_path');
$table->dropColumn('hls_transcoded_at');
$table->dropColumn('key');
$table->dropColumn('metadata');
$table->dropColumn(['original_sha256','optimized_sha256','caption','hls_path','hls_transcoded_at','key','metadata']);
});
}
}

View file

@ -27,8 +27,7 @@ class UpdateFollowerTableAddRemoteFlags extends Migration
public function down()
{
Schema::table('followers', function (Blueprint $table) {
$table->dropColumn('local_profile');
$table->dropColumn('local_following');
$table->dropColumn(['local_profile','local_following']);
});
}
}

View file

@ -30,11 +30,7 @@ class UpdateMediaAddAltText extends Migration
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('license');
$table->dropColumn('is_nsfw');
$table->dropColumn('version');
$table->dropColumn('remote_media');
$table->dropColumn('remote_url');
$table->dropColumn(['license','is_nsfw','version','remote_media','remote_url']);
});
}
}

View file

@ -16,10 +16,7 @@ class AddAccountStatusToProfilesTable extends Migration
// Drop old columns, fix stories
if(Schema::hasColumn('profiles', 'hub_url')) {
Schema::table('profiles', function (Blueprint $table) {
$table->dropColumn('verify_token');
$table->dropColumn('secret');
$table->dropColumn('salmon_url');
$table->dropColumn('hub_url');
$table->dropColumn(['verify_token','secret','salmon_url','hub_url']);
});
}

View file

@ -28,9 +28,7 @@ class UpdateProfilesTable extends Migration
public function down()
{
Schema::table('profiles', function (Blueprint $table) {
$table->dropColumn('unlisted');
$table->dropColumn('cw');
$table->dropColumn('no_autolink');
$table->dropColumn(['unlisted','cw','no_autolink']);
});
}
}

View file

@ -62,12 +62,7 @@ class Stories extends Migration
Schema::dropIfExists('story_views');
Schema::table('stories', function (Blueprint $table) {
$table->dropColumn('title');
$table->dropColumn('preview_photo');
$table->dropColumn('local_only');
$table->dropColumn('is_live');
$table->dropColumn('broadcast_url');
$table->dropColumn('broadcast_key');
$table->dropColumn(['title','preview_photo','local_only','is_live','broadcast_url','broadcast_key']);
});
Schema::table('story_reactions', function (Blueprint $table) {

View file

@ -27,8 +27,7 @@ class AddRemoteToAvatarsTable extends Migration
public function down()
{
Schema::table('avatars', function (Blueprint $table) {
$table->dropColumn('remote_url');
$table->dropColumn('last_fetched_at');
$table->dropColumn(['remote_url','last_fetched_at']);
});
}
}

View file

@ -27,8 +27,7 @@ class AddRepliesCountToStatusesTable extends Migration
public function down()
{
Schema::table('statuses', function (Blueprint $table) {
$table->dropColumn('reply_count');
$table->dropColumn('comments_disabled');
$table->dropColumn(['reply_count','comments_disabled']);
});
}
}

View file

@ -32,8 +32,7 @@ class AddLayoutToProfilesTable extends Migration
public function down()
{
Schema::table('profiles', function (Blueprint $table) {
$table->dropColumn('profile_layout');
$table->dropColumn('post_layout');
$table->dropColumn(['profile_layout','post_layout']);
});
}
}

View file

@ -6,39 +6,34 @@ use Illuminate\Support\Facades\Schema;
class AddFetchedAtToProfilesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('profiles', function (Blueprint $table) {
$table->timestamp('last_fetched_at')->nullable();
$table->unsignedInteger('status_count')->default(0)->nullable();
$table->unsignedInteger('followers_count')->default(0)->nullable();
$table->unsignedInteger('following_count')->default(0)->nullable();
$table->string('webfinger')->unique()->nullable()->index();
$table->string('avatar_url')->nullable();
$table->dropColumn('keybase_proof');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('profiles', function (Blueprint $table) {
$table->timestamp('last_fetched_at')->nullable();
$table->unsignedInteger('status_count')->default(0)->nullable();
$table->unsignedInteger('followers_count')->default(0)->nullable();
$table->unsignedInteger('following_count')->default(0)->nullable();
$table->string('webfinger')->unique()->nullable()->index();
$table->string('avatar_url')->nullable();
$table->dropColumn('keybase_proof');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('profiles', function (Blueprint $table) {
$table->dropColumn('last_fetched_at');
$table->dropColumn('status_count');
$table->dropColumn('followers_count');
$table->dropColumn('following_count');
$table->dropColumn('webfinger');
$table->dropColumn('avatar_url');
$table->text('keybase_proof')->nullable()->after('post_layout');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('profiles', function (Blueprint $table) {
$table->dropColumn(['last_fetched_at','status_count','followers_count','following_count','webfinger','avatar_url']);
$table->text('keybase_proof')->nullable()->after('post_layout');
});
}
}

View file

@ -36,16 +36,10 @@ class AddRemoteUrlToStoriesTable extends Migration
public function down()
{
Schema::table('stories', function (Blueprint $table) {
$table->dropColumn('remote_url');
$table->dropColumn('media_url');
$table->dropColumn('is_archived');
$table->dropColumn('name');
$table->dropColumn(['remote_url','media_url','is_archived','name']);
});
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('blurhash');
$table->dropColumn('srcset');
$table->dropColumn('width');
$table->dropColumn('height');
$table->dropColumn(['blurhash','srcset','width','height']);
});
}
}

View file

@ -6,31 +6,29 @@ use Illuminate\Support\Facades\Schema;
class AddTypeToDirectMessagesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('direct_messages', function (Blueprint $table) {
$table->string('type')->default('text')->nullable()->index()->after('from_id');
$table->boolean('is_hidden')->default(false)->index()->after('group_message');
$table->json('meta')->nullable()->after('is_hidden');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('direct_messages', function (Blueprint $table) {
$table->string('type')->default('text')->nullable()->index()->after('from_id');
$table->boolean('is_hidden')->default(false)->index()->after('group_message');
$table->json('meta')->nullable()->after('is_hidden');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('direct_messages', function (Blueprint $table) {
$table->dropColumn('type');
$table->dropColumn('is_hidden');
$table->dropColumn('meta');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('direct_messages', function (Blueprint $table) {
$table->dropColumn(['type','is_hidden','meta']);
});
}
}

View file

@ -6,31 +6,30 @@ use Illuminate\Support\Facades\Schema;
class AddStatusProfileIdToLikesTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('likes', function (Blueprint $table) {
$table->bigInteger('status_profile_id')->nullable()->unsigned()->index()->after('status_id');
$table->boolean('is_comment')->nullable()->index()->after('status_profile_id');
$table->dropColumn('flagged');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('likes', function (Blueprint $table) {
$table->bigInteger('status_profile_id')->nullable()->unsigned()->index()->after('status_id');
$table->boolean('is_comment')->nullable()->index()->after('status_profile_id');
$table->dropColumn('flagged');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('likes', function (Blueprint $table) {
$table->dropColumn('status_profile_id');
$table->dropColumn('is_comment');
$table->boolean('flagged')->default(false);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('likes', function (Blueprint $table) {
$table->dropColumn(['status_profile_id','is_comment']);
$table->boolean('flagged')->default(false);
});
}
}

View file

@ -6,29 +6,28 @@ use Illuminate\Support\Facades\Schema;
class AddSkipOptimizeToMediaTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('media', function (Blueprint $table) {
$table->boolean('skip_optimize')->nullable()->index();
$table->timestamp('replicated_at')->nullable();
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('media', function (Blueprint $table) {
$table->boolean('skip_optimize')->nullable()->index();
$table->timestamp('replicated_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn('skip_optimize');
$table->dropColumn('replicated_at');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('media', function (Blueprint $table) {
$table->dropColumn(['skip_optimize','replicated_at']);
});
}
}

View file

@ -6,33 +6,31 @@ use Illuminate\Support\Facades\Schema;
class AddCdnUrlToAvatarsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('avatars', function (Blueprint $table) {
$table->string('cdn_url')->unique()->index()->nullable()->after('remote_url');
$table->unsignedInteger('size')->nullable()->after('cdn_url');
$table->boolean('is_remote')->nullable()->index()->after('cdn_url');
$table->dropColumn('thumb_path');
});
}
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('avatars', function (Blueprint $table) {
$table->string('cdn_url')->unique()->index()->nullable()->after('remote_url');
$table->unsignedInteger('size')->nullable()->after('cdn_url');
$table->boolean('is_remote')->nullable()->index()->after('cdn_url');
$table->dropColumn('thumb_path');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('avatars', function (Blueprint $table) {
$table->dropColumn('cdn_url');
$table->dropColumn('size');
$table->dropColumn('is_remote');
$table->string('thumb_path')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('avatars', function (Blueprint $table) {
$table->dropColumn(['cdn_url','size','is_remote']);
$table->string('thumb_path')->nullable();
});
}
}

Binary file not shown.

BIN
public/js/timeline.js vendored

Binary file not shown.

Binary file not shown.

View file

@ -2,12 +2,12 @@
<div>
<transition name="fade">
<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">
<span class="sr-only">Loading...</span>
</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 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>
@ -86,7 +86,7 @@
<p class="mb-0 small font-weight-bold">0 Notifications!</p>
</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">
<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>
@ -103,6 +103,7 @@
export default {
data() {
return {
loading: true,
notifications: {},
notificationCursor: 2,
notificationMaxId: 0,
@ -133,8 +134,7 @@
let ids = res.data.map(n => n.id);
this.notificationMaxId = Math.min(...ids);
this.notifications = data;
$('.notification-card .loader').addClass('d-none');
$('.notification-card .contents').removeClass('d-none');
this.loading = false;
//this.notificationPoll();
});
},

View file

@ -34,7 +34,8 @@
<span class="sr-only">Loading...</span>
</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">
<announcements-card v-on:show-tips="showTips = $event"></announcements-card>
</div>
@ -118,7 +119,7 @@
</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">
<!-- <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)">
@ -280,26 +281,299 @@
</div>-->
</div>
</div>
<div v-if="!loading && feed.length">
<div class="card shadow-none">
<div class="card-body">
<div class="card rounded-0 border-top-0 status-card card-md-rounded-0 shadow-none border">
<div class="card-body py-5 my-5">
<infinite-loading @infinite="infiniteTimeline" :distance="800">
<div slot="no-more" class="font-weight-bold">No more posts to load</div>
<div slot="no-results" class="font-weight-bold">No more posts to load</div>
<div slot="no-more">
<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>
</div>
</div>
</div>
<div v-if="!loading && scope == 'home' && feed.length == 0">
<div class="card shadow-none border">
<div class="card-body text-center">
<p class="h2 font-weight-lighter p-5">Hello, {{profile.acct}}</p>
<p class="text-lighter"><i class="fas fa-camera-retro fa-5x"></i></p>
<p class="h3 font-weight-lighter p-5">Start following people to build your timeline.</p>
<p><a href="/discover" class="btn btn-primary font-weight-bold py-0">Discover new people and posts</a></p>
<div class="card rounded-0 mt-4 status-card card-md-rounded-0 shadow-none border">
<div v-if="profile.following_count != '0'" class="card-body py-5 my-5">
<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 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 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">&middot;</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 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_max_id: 0,
discover_feed: []
discover_feed: [],
recentFeed: this.scope === 'home' ? true : false,
recentFeedMin: null,
recentFeedMax: null
}
},
@ -946,6 +1223,19 @@
},
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.fetchTimelineApi();
},
@ -979,8 +1269,12 @@
this.$nextTick(function () {
$('[data-toggle="tooltip"]').tooltip();
let u = new URLSearchParams(window.location.search);
if(u.has('a') && u.get('a') == 'co') {
$('#composeModal').modal('show');
if(u.has('a')) {
switch(u.get('a')) {
case 'co':
$('#composeModal').modal('show');
break;
}
}
});
},
@ -1029,7 +1323,8 @@
axios.get(apiUrl, {
params: {
max_id: this.max_id,
limit: 3
limit: 3,
recent_feed: this.recentFeed
}
}).then(res => {
let data = res.data;
@ -1040,9 +1335,7 @@
this.max_id = Math.min(...ids).toString();
this.loading = false;
$('.timeline .pagination').removeClass('d-none');
// if(this.feed.length == 4) {
// this.fetchTimelineApi();
// }
if(this.hashtagPosts.length == 0) {
this.fetchHashtagPosts();
}
@ -1053,6 +1346,16 @@
i.href = App.util.format.rewriteLinks(i);
});
}, 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 => {
swal(
'Oops, something went wrong',
@ -1071,7 +1374,9 @@
this.loading = false;
$state.complete();
}
let apiUrl = false;
switch(this.scope) {
case 'home':
apiUrl = '/api/pixelfed/v1/timelines/home';
@ -1085,16 +1390,23 @@
apiUrl = '/api/pixelfed/v1/timelines/network';
break;
}
axios.get(apiUrl, {
params: {
max_id: this.max_id,
limit: 6
limit: 6,
recent_feed: this.recentFeed
},
}).then(res => {
if (res.data.length && this.loading == false) {
let data = res.data;
let self = this;
let vids = [];
if(self.recentFeed && self.ids.indexOf(data[0].id) != -1) {
this.loading = false;
$state.complete();
return;
}
data.forEach((d, index) => {
if(self.ids.indexOf(d.id) == -1) {
self.feed.push(d);
@ -1936,7 +2248,8 @@
axios.get(apiUrl, {
params: {
max_id: 0,
limit: 20
limit: 20,
recent_feed: this.recentFeed
}
}).then(res => {
let self = this;