diff --git a/app/Http/Controllers/InternalApiController.php b/app/Http/Controllers/InternalApiController.php
index 4ad1fd8a..5463c895 100644
--- a/app/Http/Controllers/InternalApiController.php
+++ b/app/Http/Controllers/InternalApiController.php
@@ -31,6 +31,7 @@ use League\Fractal\Pagination\IlluminatePaginatorAdapter;
use Illuminate\Validation\Rule;
use Illuminate\Support\Str;
use App\Services\ModLogService;
+use App\Services\PublicTimelineService;
class InternalApiController extends Controller
{
@@ -227,7 +228,7 @@ class InternalApiController extends Controller
$status = Status::whereScope('public')->findOrFail($item_id);
$status->scope = $status->visibility = 'unlisted';
$status->save();
- App\Services\PublicTimelineService::del($status->id);
+ PublicTimelineService::del($status->id);
ModLogService::boot()
->user(Auth::user())
->objectUid($status->profile->user_id)
diff --git a/resources/assets/js/components/Timeline.vue b/resources/assets/js/components/Timeline.vue
index f9e6db66..1432a9dd 100644
--- a/resources/assets/js/components/Timeline.vue
+++ b/resources/assets/js/components/Timeline.vue
@@ -399,55 +399,56 @@
body-class="list-group-flush p-0 rounded">
Unlist from Timelines
-
Add Content Warning
+
Remove Content Warning
+
Add Content Warning
Cancel
-
-
- Email
- Facebook
- Mastodon
- Pinterest
- Pixelfed
- Twitter
- VK
- Cancel
-
-
+
+
+ Email
+ Facebook
+ Mastodon
+ Pinterest
+ Pixelfed
+ Twitter
+ VK
+ Cancel
+
+
By using this embed, you agree to our Terms of Use
-
-
-
-
![]()
-
-
+
+
+
+
![]()
+
+
{
- swal('Success', 'Successfully enforced CW for ' + username, 'success');
+ swal('Success', 'Successfully added content warning', 'success');
+ status.sensitive = true;
+ self.ctxModMenuClose();
}).catch(err => {
swal(
'Error',
'Something went wrong, please try again later.',
'error'
);
+ self.ctxModMenuClose();
});
}
});
break;
- case 'noautolink':
- msg = 'Are you sure you want to disable auto linking for ' + username + ' ?';
+ case 'remcw':
+ msg = 'Are you sure you want to remove the content warning on this post?';
swal({
title: 'Confirm',
text: msg,
@@ -972,20 +978,23 @@
item_id: status.id,
item_type: 'status'
}).then(res => {
- swal('Success', 'Successfully disabled autolinking for ' + username, 'success');
+ swal('Success', 'Successfully added content warning', 'success');
+ status.sensitive = false;
+ self.ctxModMenuClose();
}).catch(err => {
swal(
'Error',
'Something went wrong, please try again later.',
'error'
);
+ self.ctxModMenuClose();
});
}
});
break;
- case 'unlisted':
- msg = 'Are you sure you want to unlist from timelines for ' + username + ' ?';
+ case 'unlist':
+ msg = 'Are you sure you want to unlist this post?';
swal({
title: 'Confirm',
text: msg,
@@ -999,62 +1008,13 @@
item_id: status.id,
item_type: 'status'
}).then(res => {
- swal('Success', 'Successfully unlisted for ' + username, 'success');
- }).catch(err => {
- swal(
- 'Error',
- 'Something went wrong, please try again later.',
- 'error'
- );
- });
- }
- });
- break;
-
- case 'disable':
- msg = 'Are you sure you want to disable ' + username + '’s account ?';
- swal({
- title: 'Confirm',
- text: msg,
- icon: 'warning',
- buttons: true,
- dangerMode: true
- }).then(res => {
- if(res) {
- axios.post('/api/v2/moderator/action', {
- action: action,
- item_id: status.id,
- item_type: 'status'
- }).then(res => {
- swal('Success', 'Successfully disabled ' + username + '’s account', 'success');
- }).catch(err => {
- swal(
- 'Error',
- 'Something went wrong, please try again later.',
- 'error'
- );
- });
- }
- });
- break;
-
- case 'suspend':
- msg = 'Are you sure you want to suspend ' + username + '’s account ?';
- swal({
- title: 'Confirm',
- text: msg,
- icon: 'warning',
- buttons: true,
- dangerMode: true
- }).then(res => {
- if(res) {
- axios.post('/api/v2/moderator/action', {
- action: action,
- item_id: status.id,
- item_type: 'status'
- }).then(res => {
- swal('Success', 'Successfully suspend ' + username + '’s account', 'success');
+ this.feed = this.feed.filter(f => {
+ return f.id != status.id;
+ });
+ swal('Success', 'Successfully unlisted post', 'success');
+ self.ctxModMenuClose();
}).catch(err => {
+ self.ctxModMenuClose();
swal(
'Error',
'Something went wrong, please try again later.',