diff --git a/CHANGELOG.md b/CHANGELOG.md index 94f2d693e..5791c4f6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,12 @@ - Update ApiV1Controller, fix hashtag timeline ([fc1a385c](https://github.com/pixelfed/pixelfed/commit/fc1a385c)) - Update settings view, add fallback avatar ([1a83c585](https://github.com/pixelfed/pixelfed/commit/1a83c585)) - Update HashtagFollow model, add MAX_LIMIT of 250 tags per account ([ed352141](https://github.com/pixelfed/pixelfed/commit/ed352141)) +- Update Notification logic, remove message and rendered fields ([6cdb5bc6](https://github.com/pixelfed/pixelfed/commit/6cdb5bc6)) +- Update InstanceService, fix banner blurhash memory bug ([3aad75ab](https://github.com/pixelfed/pixelfed/commit/3aad75ab)) +- Update models, remove deprecated toText and toHtml method ([ea943333](https://github.com/pixelfed/pixelfed/commit/ea943333)) +- Update Notification components, add autospam notification support ([0d3b4bc2](https://github.com/pixelfed/pixelfed/commit/0d3b4bc2)) +- Update AutoSpam Bouncer, generate notification on positive detections ([d5f63f8a](https://github.com/pixelfed/pixelfed/commit/d5f63f8a)) +- Update admin autospam apis, remove autospam warning notifications when appropriate ([588ca653](https://github.com/pixelfed/pixelfed/commit/588ca653)) - ([](https://github.com/pixelfed/pixelfed/commit/)) ## [v0.11.6 (2023-05-03)](https://github.com/pixelfed/pixelfed/compare/v0.11.5...v0.11.6) diff --git a/app/DirectMessage.php b/app/DirectMessage.php index 2f4ea7872..ee109aee2 100644 --- a/app/DirectMessage.php +++ b/app/DirectMessage.php @@ -31,20 +31,4 @@ class DirectMessage extends Model { return Auth::user()->profile->id === $this->from_id; } - - public function toText() - { - $actorName = $this->author->username; - - return "{$actorName} sent a direct message."; - } - - public function toHtml() - { - $actorName = $this->author->username; - $actorUrl = $this->author->url(); - $url = $this->url(); - - return "{$actorName} sent a direct message."; - } } diff --git a/app/Follower.php b/app/Follower.php index 9ec6d9f65..7415a7fe8 100644 --- a/app/Follower.php +++ b/app/Follower.php @@ -32,20 +32,4 @@ class Follower extends Model $path = $this->actor->permalink("#accepts/follows/{$this->id}{$append}"); return url($path); } - - public function toText() - { - $actorName = $this->actor->username; - - return "{$actorName} ".__('notification.startedFollowingYou'); - } - - public function toHtml() - { - $actorName = $this->actor->username; - $actorUrl = $this->actor->url(); - - return "{$actorName} ". - __('notification.startedFollowingYou'); - } } diff --git a/app/Http/Controllers/Admin/AdminReportController.php b/app/Http/Controllers/Admin/AdminReportController.php index 2ee8e02c5..ba3acb040 100644 --- a/app/Http/Controllers/Admin/AdminReportController.php +++ b/app/Http/Controllers/Admin/AdminReportController.php @@ -14,6 +14,7 @@ use App\{ Contact, Hashtag, Newsroom, + Notification, OauthClient, Profile, Report, @@ -30,6 +31,7 @@ use App\Jobs\DeletePipeline\DeleteRemoteStatusPipeline; use App\Jobs\StatusPipeline\StatusDelete; use App\Http\Resources\AdminReport; use App\Http\Resources\AdminSpamReport; +use App\Services\NotificationService; use App\Services\PublicTimelineService; use App\Services\NetworkTimelineService; @@ -1126,6 +1128,14 @@ trait AdminReportController $appeal->appeal_handled_at = now(); $appeal->save(); + Notification::whereAction('autospam.warning') + ->whereProfileId($appeal->user->profile_id) + ->get() + ->each(function($n) use($appeal) { + NotificationService::del($appeal->user->profile_id, $n->id); + $n->forceDelete(); + }); + StatusService::del($status->id); } @@ -1157,6 +1167,13 @@ trait AdminReportController $status->save(); StatusService::del($status->id); } + Notification::whereAction('autospam.warning') + ->whereProfileId($report->user->profile_id) + ->get() + ->each(function($n) use($report) { + NotificationService::del($report->user->profile_id, $n->id); + $n->forceDelete(); + }); }); } diff --git a/app/Http/Controllers/Api/AdminApiController.php b/app/Http/Controllers/Api/AdminApiController.php index 52ab197ca..ed3773bbc 100644 --- a/app/Http/Controllers/Api/AdminApiController.php +++ b/app/Http/Controllers/Api/AdminApiController.php @@ -11,6 +11,7 @@ use App\{ AccountInterstitial, Instance, Like, + Notification, Media, Profile, Report, @@ -140,6 +141,14 @@ class AdminApiController extends Controller StatusService::del($status->id); + Notification::whereAction('autospam.warning') + ->whereProfileId($appeal->user->profile_id) + ->get() + ->each(function($n) use($appeal) { + NotificationService::del($appeal->user->profile_id, $n->id); + $n->forceDelete(); + }); + Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $appeal->user->profile_id); Cache::forget('pf:bouncer_v0:recent_by_pid:' . $appeal->user->profile_id); Cache::forget('admin-dash:reports:spam-count'); @@ -164,6 +173,14 @@ class AdminApiController extends Controller $status->save(); StatusService::del($status->id, true); } + + Notification::whereAction('autospam.warning') + ->whereProfileId($report->user->profile_id) + ->get() + ->each(function($n) use($report) { + NotificationService::del($report->user->profile_id, $n->id); + $n->forceDelete(); + }); }); Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $appeal->user->profile_id); Cache::forget('pf:bouncer_v0:recent_by_pid:' . $appeal->user->profile_id); diff --git a/app/Http/Controllers/DirectMessageController.php b/app/Http/Controllers/DirectMessageController.php index 5346be845..1f7e04e59 100644 --- a/app/Http/Controllers/DirectMessageController.php +++ b/app/Http/Controllers/DirectMessageController.php @@ -368,8 +368,6 @@ class DirectMessageController extends Controller $notification->profile_id = $recipient->id; $notification->actor_id = $profile->id; $notification->action = 'dm'; - $notification->message = $dm->toText(); - $notification->rendered = $dm->toHtml(); $notification->item_id = $dm->id; $notification->item_type = "App\DirectMessage"; $notification->save(); diff --git a/app/Http/Controllers/Stories/StoryApiV1Controller.php b/app/Http/Controllers/Stories/StoryApiV1Controller.php index 16d1805b9..e32fffa26 100644 --- a/app/Http/Controllers/Stories/StoryApiV1Controller.php +++ b/app/Http/Controllers/Stories/StoryApiV1Controller.php @@ -328,8 +328,6 @@ class StoryApiV1Controller extends Controller $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:comment'; - $n->message = "{$request->user()->username} commented on story"; - $n->rendered = "{$request->user()->username} commented on story"; $n->save(); } else { StoryReplyDeliver::dispatch($story, $status)->onQueue('story'); diff --git a/app/Http/Controllers/StoryComposeController.php b/app/Http/Controllers/StoryComposeController.php index f913d859f..8f9358b74 100644 --- a/app/Http/Controllers/StoryComposeController.php +++ b/app/Http/Controllers/StoryComposeController.php @@ -442,8 +442,6 @@ class StoryComposeController extends Controller $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:react'; - $n->message = "{$request->user()->username} reacted to your story"; - $n->rendered = "{$request->user()->username} reacted to your story"; $n->save(); } else { StoryReactionDeliver::dispatch($story, $status)->onQueue('story'); @@ -516,8 +514,6 @@ class StoryComposeController extends Controller $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:comment'; - $n->message = "{$request->user()->username} commented on story"; - $n->rendered = "{$request->user()->username} commented on story"; $n->save(); } else { StoryReplyDeliver::dispatch($story, $status)->onQueue('story'); diff --git a/app/Jobs/CommentPipeline/CommentPipeline.php b/app/Jobs/CommentPipeline/CommentPipeline.php index 0ae4ed4a2..064795de8 100644 --- a/app/Jobs/CommentPipeline/CommentPipeline.php +++ b/app/Jobs/CommentPipeline/CommentPipeline.php @@ -94,8 +94,6 @@ class CommentPipeline implements ShouldQueue $notification->profile_id = $target->id; $notification->actor_id = $actor->id; $notification->action = 'comment'; - $notification->message = $comment->replyToText(); - $notification->rendered = $comment->replyToHtml(); $notification->item_id = $comment->id; $notification->item_type = "App\Status"; $notification->save(); diff --git a/app/Jobs/FollowPipeline/FollowPipeline.php b/app/Jobs/FollowPipeline/FollowPipeline.php index 2bda4057f..6db85fa6a 100644 --- a/app/Jobs/FollowPipeline/FollowPipeline.php +++ b/app/Jobs/FollowPipeline/FollowPipeline.php @@ -97,8 +97,6 @@ class FollowPipeline implements ShouldQueue $notification->profile_id = $target->id; $notification->actor_id = $actor->id; $notification->action = 'follow'; - $notification->message = $follower->toText(); - $notification->rendered = $follower->toHtml(); $notification->item_id = $target->id; $notification->item_type = "App\Profile"; $notification->save(); diff --git a/app/Jobs/LikePipeline/LikePipeline.php b/app/Jobs/LikePipeline/LikePipeline.php index d2be251ac..b44c90c8b 100644 --- a/app/Jobs/LikePipeline/LikePipeline.php +++ b/app/Jobs/LikePipeline/LikePipeline.php @@ -84,8 +84,6 @@ class LikePipeline implements ShouldQueue $notification->profile_id = $status->profile_id; $notification->actor_id = $actor->id; $notification->action = 'like'; - $notification->message = $like->toText($status->in_reply_to_id ? 'comment' : 'post'); - $notification->rendered = $like->toHtml($status->in_reply_to_id ? 'comment' : 'post'); $notification->item_id = $status->id; $notification->item_type = "App\Status"; $notification->save(); diff --git a/app/Jobs/MentionPipeline/MentionPipeline.php b/app/Jobs/MentionPipeline/MentionPipeline.php index 2186af9d5..cec42f09d 100644 --- a/app/Jobs/MentionPipeline/MentionPipeline.php +++ b/app/Jobs/MentionPipeline/MentionPipeline.php @@ -67,10 +67,6 @@ class MentionPipeline implements ShouldQueue 'action' => 'mention', 'item_type' => 'App\Status', 'item_id' => $status->id, - ], - [ - 'message' => $mention->toText(), - 'rendered' => $mention->toHtml() ] ); diff --git a/app/Jobs/SharePipeline/SharePipeline.php b/app/Jobs/SharePipeline/SharePipeline.php index 528c78ca2..0b580500b 100644 --- a/app/Jobs/SharePipeline/SharePipeline.php +++ b/app/Jobs/SharePipeline/SharePipeline.php @@ -76,10 +76,6 @@ class SharePipeline implements ShouldQueue 'action' => 'share', 'item_type' => 'App\Status', 'item_id' => $status->reblog_of_id ?? $status->id, - ], - [ - 'message' => $status->shareToText(), - 'rendered' => $status->shareToHtml() ] ); diff --git a/app/Jobs/StatusPipeline/StatusReplyPipeline.php b/app/Jobs/StatusPipeline/StatusReplyPipeline.php index 2c41aa146..755faba8f 100644 --- a/app/Jobs/StatusPipeline/StatusReplyPipeline.php +++ b/app/Jobs/StatusPipeline/StatusReplyPipeline.php @@ -90,8 +90,6 @@ class StatusReplyPipeline implements ShouldQueue $notification->profile_id = $target->id; $notification->actor_id = $actor->id; $notification->action = 'comment'; - $notification->message = $status->replyToText(); - $notification->rendered = $status->replyToHtml(); $notification->item_id = $status->id; $notification->item_type = "App\Status"; $notification->save(); diff --git a/app/Like.php b/app/Like.php index 2c2cd80f9..c5b000c66 100644 --- a/app/Like.php +++ b/app/Like.php @@ -31,21 +31,4 @@ class Like extends Model { return $this->belongsTo(Status::class); } - - public function toText($type = 'post') - { - $actorName = $this->actor->username; - $msg = $type == 'post' ? __('notification.likedPhoto') : __('notification.likedComment'); - - return "{$actorName} ".$msg; - } - - public function toHtml($type = 'post') - { - $actorName = $this->actor->username; - $actorUrl = $this->actor->url(); - $msg = $type == 'post' ? __('notification.likedPhoto') : __('notification.likedComment'); - - return "{$actorName} ".$msg; - } } diff --git a/app/Mention.php b/app/Mention.php index e0c30d35c..fab8d9c86 100644 --- a/app/Mention.php +++ b/app/Mention.php @@ -29,20 +29,4 @@ class Mention extends Model { return $this->belongsTo(Status::class, 'status_id', 'id'); } - - public function toText() - { - $actorName = $this->status->profile->username; - - return "{$actorName} ".__('notification.mentionedYou'); - } - - public function toHtml() - { - $actorName = $this->status->profile->username; - $actorUrl = $this->status->profile->url(); - - return "{$actorName} ". - __('notification.mentionedYou'); - } } diff --git a/app/Services/ConfigCacheService.php b/app/Services/ConfigCacheService.php index 23b762486..7ecb318e0 100644 --- a/app/Services/ConfigCacheService.php +++ b/app/Services/ConfigCacheService.php @@ -69,6 +69,7 @@ class ConfigCacheService 'instance.landing.show_directory', 'instance.landing.show_explore', 'instance.admin.pid', + 'instance.banner.blurhash' // 'system.user_mode' ]; diff --git a/app/Services/InstanceService.php b/app/Services/InstanceService.php index c2a33a888..1cead8d48 100644 --- a/app/Services/InstanceService.php +++ b/app/Services/InstanceService.php @@ -5,6 +5,7 @@ namespace App\Services; use Cache; use App\Instance; use App\Util\Blurhash\Blurhash; +use App\Services\ConfigCacheService; class InstanceService { @@ -13,7 +14,12 @@ class InstanceService const CACHE_KEY_UNLISTED_DOMAINS = 'instances:unlisted:domains'; const CACHE_KEY_NSFW_DOMAINS = 'instances:auto_cw:domains'; const CACHE_KEY_STATS = 'pf:services:instances:stats'; - const CACHE_KEY_BANNER_BLURHASH = 'pf:services:instance:header-blurhash'; + const CACHE_KEY_BANNER_BLURHASH = 'pf:services:instance:header-blurhash:v1'; + + public function __construct() + { + ini_set('memory_limit', config('pixelfed.memory_limit', '1024M')); + } public static function getByDomain($domain) { @@ -87,6 +93,12 @@ class InstanceService if(str_ends_with(config_cache('app.banner_image'), 'headers/default.jpg')) { return 'UzJR]l{wHZRjM}R%XRkCH?X9xaWEjZj]kAjt'; } + $cached = config_cache('instance.banner.blurhash'); + + if($cached) { + return $cached; + } + $file = config_cache('app.banner_image') ?? url(Storage::url('public/headers/default.jpg')); $image = imagecreatefromstring(file_get_contents($file)); @@ -115,6 +127,8 @@ class InstanceService return 'UzJR]l{wHZRjM}R%XRkCH?X9xaWEjZj]kAjt'; } + ConfigCacheService::put('instance.banner.blurhash', $blurhash); + return $blurhash; }); } diff --git a/app/Services/MediaTagService.php b/app/Services/MediaTagService.php index ef436ec0a..e974d258c 100644 --- a/app/Services/MediaTagService.php +++ b/app/Services/MediaTagService.php @@ -74,16 +74,13 @@ class MediaTagService { $p = $tag->status->profile; $actor = $p->username; - $message = "{$actor} tagged you in a post."; - $rendered = "{$actor} tagged you in a post."; + $n = new Notification; $n->profile_id = $tag->profile_id; $n->actor_id = $p->id; $n->item_id = $tag->id; $n->item_type = 'App\MediaTag'; $n->action = 'tagged'; - $n->message = $message; - $n->rendered = $rendered; $n->save(); return; } diff --git a/app/Services/ModLogService.php b/app/Services/ModLogService.php index e8e44465f..2f4674610 100644 --- a/app/Services/ModLogService.php +++ b/app/Services/ModLogService.php @@ -108,8 +108,6 @@ class ModLogService { { $log = $this->log; - $msg = "{$log->user_username} commented on a modlog"; - $rendered = "{$log->user_username} commented on a modlog"; $item_id = $log->id; $item_type = 'App\ModLog'; $action = 'admin.user.modlog.comment'; @@ -127,8 +125,6 @@ class ModLogService { $n->item_id = $item_id; $n->item_type = $item_type; $n->action = $action; - $n->message = $msg; - $n->rendered = $rendered; $n->save(); } } @@ -139,4 +135,4 @@ class ModLogService { ->whereItemId($this->log->id) ->delete(); } -} \ No newline at end of file +} diff --git a/app/Status.php b/app/Status.php index ae4ea299d..183c18023 100644 --- a/app/Status.php +++ b/app/Status.php @@ -285,38 +285,6 @@ class Status extends Model return $obj; } - public function replyToText() - { - $actorName = $this->profile->username; - - return "{$actorName} ".__('notification.commented'); - } - - public function replyToHtml() - { - $actorName = $this->profile->username; - $actorUrl = $this->profile->url(); - - return "{$actorName} ". - __('notification.commented'); - } - - public function shareToText() - { - $actorName = $this->profile->username; - - return "{$actorName} ".__('notification.shared'); - } - - public function shareToHtml() - { - $actorName = $this->profile->username; - $actorUrl = $this->profile->url(); - - return "{$actorName} ". - __('notification.shared'); - } - public function recentComments() { return $this->comments()->orderBy('created_at', 'desc')->take(3); diff --git a/app/Transformer/Api/NotificationTransformer.php b/app/Transformer/Api/NotificationTransformer.php index d4f84bbef..837c027af 100644 --- a/app/Transformer/Api/NotificationTransformer.php +++ b/app/Transformer/Api/NotificationTransformer.php @@ -23,7 +23,9 @@ class NotificationTransformer extends Fractal\TransformerAbstract if($n->actor_id) { $res['account'] = AccountService::get($n->actor_id); - $res['relationship'] = RelationshipService::get($n->actor_id, $n->profile_id); + if($n->profile_id != $n->actor_id) { + $res['relationship'] = RelationshipService::get($n->actor_id, $n->profile_id); + } } if($n->item_id && $n->item_type == 'App\Status') { @@ -66,11 +68,8 @@ class NotificationTransformer extends Fractal\TransformerAbstract 'comment' => 'comment', 'admin.user.modlog.comment' => 'modlog', 'tagged' => 'tagged', - 'group:comment' => 'group:comment', 'story:react' => 'story:react', 'story:comment' => 'story:comment', - 'group:join:approved' => 'group:join:approved', - 'group:join:rejected' => 'group:join:rejected' ]; if(!isset($verbs[$verb])) { diff --git a/app/Util/ActivityPub/Inbox.php b/app/Util/ActivityPub/Inbox.php index a852e75cc..70dea452a 100644 --- a/app/Util/ActivityPub/Inbox.php +++ b/app/Util/ActivityPub/Inbox.php @@ -483,8 +483,6 @@ class Inbox $notification->profile_id = $profile->id; $notification->actor_id = $actor->id; $notification->action = 'dm'; - $notification->message = $dm->toText(); - $notification->rendered = $dm->toHtml(); $notification->item_id = $dm->id; $notification->item_type = "App\DirectMessage"; $notification->save(); @@ -594,9 +592,6 @@ class Inbox 'action' => 'share', 'item_id' => $parent->id, 'item_type' => 'App\Status', - ], [ - 'message' => $status->replyToText(), - 'rendered' => $status->replyToHtml(), ] ); @@ -1023,8 +1018,6 @@ class Inbox $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:react'; - $n->message = "{$actorProfile->username} reacted to your story"; - $n->rendered = "{$actorProfile->username} reacted to your story"; $n->save(); return; @@ -1134,8 +1127,6 @@ class Inbox $n->item_id = $dm->id; $n->item_type = 'App\DirectMessage'; $n->action = 'story:comment'; - $n->message = "{$actorProfile->username} commented on story"; - $n->rendered = "{$actorProfile->username} commented on story"; $n->save(); return; diff --git a/app/Util/Sentiment/Bouncer.php b/app/Util/Sentiment/Bouncer.php index c0a151a9b..aa59d1404 100644 --- a/app/Util/Sentiment/Bouncer.php +++ b/app/Util/Sentiment/Bouncer.php @@ -6,8 +6,10 @@ use App\AccountInterstitial; use App\Status; use Cache; use Illuminate\Support\Str; +use App\Services\NotificationService; use App\Services\StatusService; use App\Jobs\ReportPipeline\AutospamNotifyAdminViaEmail; +use App\Notification; class Bouncer { @@ -140,6 +142,15 @@ class Bouncer { // $status->is_nsfw = true; $status->save(); + $notification = new Notification(); + $notification->profile_id = $status->profile_id; + $notification->actor_id = $status->profile_id; + $notification->action = 'autospam.warning'; + $notification->item_id = $status->id; + $notification->item_type = "App\Status"; + $notification->save(); + NotificationService::add($notification->profile_id, $notification->id); + StatusService::del($status->id); Cache::forget('pf:bouncer_v0:exemption_by_pid:' . $status->profile_id); diff --git a/config/instance.php b/config/instance.php index 9d10e2107..5161ecb80 100644 --- a/config/instance.php +++ b/config/instance.php @@ -124,5 +124,9 @@ return [ 'landing' => [ 'show_directory' => env('INSTANCE_LANDING_SHOW_DIRECTORY', true), 'show_explore' => env('INSTANCE_LANDING_SHOW_EXPLORE', true), + ], + + 'banner' => [ + 'blurhash' => env('INSTANCE_BANNER_BLURHASH', 'UzJR]l{wHZRjM}R%XRkCH?X9xaWEjZj]kAjt') ] ]; diff --git a/public/js/discover.chunk.4f1b3ea93df06670.js b/public/js/discover.chunk.4f1b3ea93df06670.js deleted file mode 100644 index 304f6631b..000000000 Binary files a/public/js/discover.chunk.4f1b3ea93df06670.js and /dev/null differ diff --git a/public/js/discover.chunk.5ceb85dcb38dfbef.js b/public/js/discover.chunk.5ceb85dcb38dfbef.js new file mode 100644 index 000000000..58fee9f71 Binary files /dev/null and b/public/js/discover.chunk.5ceb85dcb38dfbef.js differ diff --git a/public/js/discover~hashtag.bundle.279c3460159d3af7.js b/public/js/discover~hashtag.bundle.279c3460159d3af7.js deleted file mode 100644 index f5a6ff81e..000000000 Binary files a/public/js/discover~hashtag.bundle.279c3460159d3af7.js and /dev/null differ diff --git a/public/js/discover~hashtag.bundle.b8319d6999d3e2e3.js b/public/js/discover~hashtag.bundle.b8319d6999d3e2e3.js new file mode 100644 index 000000000..ea976a083 Binary files /dev/null and b/public/js/discover~hashtag.bundle.b8319d6999d3e2e3.js differ diff --git a/public/js/home.chunk.25bd77760873ee83.js b/public/js/home.chunk.25bd77760873ee83.js deleted file mode 100644 index d77872427..000000000 Binary files a/public/js/home.chunk.25bd77760873ee83.js and /dev/null differ diff --git a/public/js/home.chunk.af8ef7b54f61b18d.js b/public/js/home.chunk.af8ef7b54f61b18d.js new file mode 100644 index 000000000..abe40b28e Binary files /dev/null and b/public/js/home.chunk.af8ef7b54f61b18d.js differ diff --git a/public/js/manifest.js b/public/js/manifest.js index e8f53e356..c1bfd97d6 100644 Binary files a/public/js/manifest.js and b/public/js/manifest.js differ diff --git a/public/js/notifications.chunk.1a834e4a7bdbf21a.js b/public/js/notifications.chunk.1a834e4a7bdbf21a.js deleted file mode 100644 index 78ef17ef1..000000000 Binary files a/public/js/notifications.chunk.1a834e4a7bdbf21a.js and /dev/null differ diff --git a/public/js/notifications.chunk.9de71a122956c663.js b/public/js/notifications.chunk.9de71a122956c663.js new file mode 100644 index 000000000..d3d6b6153 Binary files /dev/null and b/public/js/notifications.chunk.9de71a122956c663.js differ diff --git a/public/js/post.chunk.62a9d21c9016fd95.js b/public/js/post.chunk.62a9d21c9016fd95.js new file mode 100644 index 000000000..af462a50d Binary files /dev/null and b/public/js/post.chunk.62a9d21c9016fd95.js differ diff --git a/public/js/post.chunk.881f8b0a9934e053.js b/public/js/post.chunk.881f8b0a9934e053.js deleted file mode 100644 index 370f1459b..000000000 Binary files a/public/js/post.chunk.881f8b0a9934e053.js and /dev/null differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index d2367576e..beeaf8368 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/components/Notifications.vue b/resources/assets/components/Notifications.vue new file mode 100644 index 000000000..2fb085b4e --- /dev/null +++ b/resources/assets/components/Notifications.vue @@ -0,0 +1,585 @@ + + + + + diff --git a/resources/assets/components/sections/Notifications.vue b/resources/assets/components/sections/Notifications.vue index 276bac037..c1dfc9999 100644 --- a/resources/assets/components/sections/Notifications.vue +++ b/resources/assets/components/sections/Notifications.vue @@ -37,6 +37,15 @@
+

+
+

+ Your recent post has been unlisted. +

+

+ Click here for more info. +

+

{{n.account.local == false ? '@':''}}{{truncate(n.account.username)}} commented on your post. @@ -383,6 +400,20 @@ } }) }, + + showAutospamInfo(status) { + let el = document.createElement('p'); + el.classList.add('text-left'); + el.classList.add('mb-0'); + el.innerHTML = '

We use automated systems to help detect potential abuse and spam. Your recent post was flagged for review.

Don\'t worry! Your post will be reviewed by a human, and they will restore your post if they determine it appropriate.

Once a human approves your post, any posts you create after will not be marked as unlisted. If you delete this post and share more posts before a human can approve any of them, you will need to wait for at least one unlisted post to be reviewed by a human.'; + let wrapper = document.createElement('div'); + wrapper.appendChild(el); + swal({ + title: 'Why was my post unlisted?', + content: wrapper, + icon: 'warning' + }) + } } }