From 1e88bb4b6371cabb43c0f5fa4c59e14870d38593 Mon Sep 17 00:00:00 2001
From: Daniel Supernault
Date: Sat, 6 Apr 2019 23:02:08 -0600
Subject: [PATCH 01/74] Update network timeline view
---
resources/views/timeline/network.blade.php | 1 +
1 file changed, 1 insertion(+)
diff --git a/resources/views/timeline/network.blade.php b/resources/views/timeline/network.blade.php
index 1fc7c639f..1ba58d090 100644
--- a/resources/views/timeline/network.blade.php
+++ b/resources/views/timeline/network.blade.php
@@ -8,6 +8,7 @@
@push('scripts')
+
From 11ce7e617d4343053e1ebd933af1910d5a698f4c Mon Sep 17 00:00:00 2001
From: Daniel Supernault
Date: Fri, 12 Apr 2019 23:28:23 -0600
Subject: [PATCH 34/74] Fixes #658
---
app/Http/Controllers/PublicApiController.php | 4 ++--
app/Http/Controllers/StatusController.php | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php
index c764f27cd..263b2a35a 100644
--- a/app/Http/Controllers/PublicApiController.php
+++ b/app/Http/Controllers/PublicApiController.php
@@ -180,8 +180,8 @@ class PublicApiController extends Controller
if(!$user) {
abort(403);
} else {
- $follows = $profile->followedBy(Auth::user()->profile);
- if($follows == false && $profile->id !== $user->profile->id) {
+ $follows = $profile->followedBy($user->profile);
+ if($follows == false && $profile->id !== $user->profile->id && $user->is_admin == false) {
abort(404);
}
}
diff --git a/app/Http/Controllers/StatusController.php b/app/Http/Controllers/StatusController.php
index ad477fd26..c6e38754b 100644
--- a/app/Http/Controllers/StatusController.php
+++ b/app/Http/Controllers/StatusController.php
@@ -42,11 +42,11 @@ class StatusController extends Controller
if($status->visibility == 'private' || $user->is_private) {
if(!Auth::check()) {
- abort(403);
+ abort(404);
}
$pid = Auth::user()->profile;
- if($user->followedBy($pid) == false && $user->id !== $pid->id) {
- abort(403);
+ if($user->followedBy($pid) == false && $user->id !== $pid->id && Auth::user()->is_admin == false) {
+ abort(404);
}
}
From 6fcbace0d8c6ffae00c2f75a0d7199fa9050482e Mon Sep 17 00:00:00 2001
From: Daniel Supernault
Date: Sat, 13 Apr 2019 14:44:58 -0600
Subject: [PATCH 35/74] Update CommentController, increment reply count
---
app/Http/Controllers/CommentController.php | 24 ++++++++++++++--------
1 file changed, 16 insertions(+), 8 deletions(-)
diff --git a/app/Http/Controllers/CommentController.php b/app/Http/Controllers/CommentController.php
index 703241ce7..0a8e3b662 100644
--- a/app/Http/Controllers/CommentController.php
+++ b/app/Http/Controllers/CommentController.php
@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Auth;
+use DB;
use Cache;
use App\Comment;
@@ -58,14 +59,21 @@ class CommentController extends Controller
Cache::forget('transform:status:'.$status->url());
- $autolink = Autolink::create()->autolink($comment);
- $reply = new Status();
- $reply->profile_id = $profile->id;
- $reply->caption = e($comment);
- $reply->rendered = $autolink;
- $reply->in_reply_to_id = $status->id;
- $reply->in_reply_to_profile_id = $status->profile_id;
- $reply->save();
+ $reply = DB::transaction(function() use($comment, $status, $profile) {
+ $autolink = Autolink::create()->autolink($comment);
+ $reply = new Status();
+ $reply->profile_id = $profile->id;
+ $reply->caption = e($comment);
+ $reply->rendered = $autolink;
+ $reply->in_reply_to_id = $status->id;
+ $reply->in_reply_to_profile_id = $status->profile_id;
+ $reply->save();
+
+ $status->reply_count++;
+ $status->save();
+
+ return $reply;
+ });
NewStatusPipeline::dispatch($reply, false);
CommentPipeline::dispatch($status, $reply);
From 20957afccc3e7ae52012a6a616881b1d43ffc518 Mon Sep 17 00:00:00 2001
From: Daniel Supernault
Date: Sat, 13 Apr 2019 21:25:34 -0600
Subject: [PATCH 36/74] Update PublicApiController
---
app/Http/Controllers/PublicApiController.php | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/app/Http/Controllers/PublicApiController.php b/app/Http/Controllers/PublicApiController.php
index 263b2a35a..e49174b36 100644
--- a/app/Http/Controllers/PublicApiController.php
+++ b/app/Http/Controllers/PublicApiController.php
@@ -108,6 +108,7 @@ class PublicApiController extends Controller
'max_id' => 'nullable|integer|min:1|max:'.PHP_INT_MAX,
'limit' => 'nullable|integer|min:5|max:50'
]);
+
$limit = $request->limit ?? 10;
$profile = Profile::whereUsername($username)->whereNull('status')->firstOrFail();
$status = Status::whereProfileId($profile->id)->whereCommentsDisabled(false)->findOrFail($postId);
@@ -116,7 +117,7 @@ class PublicApiController extends Controller
if($request->filled('min_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
- ->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'created_at')
+ ->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '>=', $request->min_id)
->orderBy('id', 'desc')
->paginate($limit);
@@ -124,7 +125,7 @@ class PublicApiController extends Controller
if($request->filled('max_id')) {
$replies = $status->comments()
->whereNull('reblog_of_id')
- ->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'created_at')
+ ->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->where('id', '<=', $request->max_id)
->orderBy('id', 'desc')
->paginate($limit);
@@ -132,7 +133,7 @@ class PublicApiController extends Controller
} else {
$replies = $status->comments()
->whereNull('reblog_of_id')
- ->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'created_at')
+ ->select('id', 'caption', 'rendered', 'profile_id', 'in_reply_to_id', 'type', 'reply_count', 'created_at')
->orderBy('id', 'desc')
->paginate($limit);
}
From 58a9d5af98b2de9188f0db8b436afaa6e9a553f2 Mon Sep 17 00:00:00 2001
From: Daniel Supernault
Date: Mon, 15 Apr 2019 12:24:02 -0600
Subject: [PATCH 37/74] Update PostComponent
---
.../assets/js/components/PostComponent.vue | 48 ++++++++++++++++---
1 file changed, 42 insertions(+), 6 deletions(-)
diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue
index c0c157106..eb207c547 100644
--- a/resources/assets/js/components/PostComponent.vue
+++ b/resources/assets/js/components/PostComponent.vue
@@ -137,6 +137,18 @@
+
+
+
+
+
@@ -331,7 +343,7 @@
}
.emoji-reactions .nav-item {
font-size: 1.2rem;
- padding: 7px;
+ padding: 9px;
cursor: pointer;
}
.emoji-reactions::-webkit-scrollbar {
@@ -372,7 +384,9 @@ export default {
showComments: false,
warning: false,
loaded: false,
- loading: null
+ loading: null,
+ replyingToId: this.statusId,
+ emoji: ['😀','😁','😂','🤣','😃','😄','😅','😆','😉','😊','😋','😎','😍','😘','😗','😙','😚','☺️','🙂','🤗','🤩','🤔','🤨','😐','😑','😶','🙄','😏','😣','😥','😮','🤐','😯','😪','😫','😴','😌','😛','😜','😝','🤤','😒','😓','😔','😕','🙃','🤑','😲','☹️','🙁','😖','😞','😟','😤','😢','😭','😦','😧','😨','😩','🤯','😬','😰','😱','😳','🤪','😵','😡','😠','🤬','😷','🤒','🤕','🤢','🤮','🤧','😇','🤠','🤡','🤥','🤫','🤭','🧐','🤓','😈','👿','👹','👺','💀','👻','👽','🤖','💩','😺','😸','😹','😻','😼','😽','🙀','😿','😾','🤲','👐','🙌','👏','🤝','👍','👎','👊','✊','🤛','🤜','🤞','✌️','🤟','🤘','👌','👈','👉','👆','👇','☝️','✋','🤚','🖐','🖖','👋','🤙','💪','🖕','✍️','🙏','💍','💄','💋','👄','👅','👂','👃','👣','👁','👀','🧠','🗣','👤','👥'],
}
},
@@ -668,16 +682,20 @@ export default {
return;
}
let data = {
- item: this.statusId,
+ item: this.replyingToId,
comment: this.replyText
}
axios.post('/i/comment', data)
.then(function(res) {
let entity = res.data.entity;
- self.results.push(entity);
+ if(entity.in_reply_to_id == self.status.id) {
+ self.results.push(entity);
+ let elem = $('.status-comments')[0];
+ elem.scrollTop = elem.clientHeight;
+ } else {
+
+ }
self.replyText = '';
- let elem = $('.status-comments')[0];
- elem.scrollTop = elem.clientHeight;
});
},
@@ -699,6 +717,7 @@ export default {
},
replyFocus(e) {
+ this.replyingToId = e.id;
this.reply_to_profile_id = e.account.id;
this.replyText = '@' + e.account.username + ' ';
$('textarea[name="comment"]').focus();
@@ -910,6 +929,23 @@ export default {
swal('Private Post', 'This post is only visible to followers.', 'info');
break;
}
+ },
+
+ toggleReplies(reply) {
+ if(reply.thread) {
+ reply.thread = false;
+ } else {
+ if(reply.replies.length > 0) {
+ reply.thread = true;
+ return;
+ }
+ let url = '/api/v2/comments/'+reply.account.username+'/status/'+reply.id;
+ axios.get(url)
+ .then(response => {
+ reply.replies = _.reverse(response.data.data);
+ reply.thread = true;
+ });
+ }
}
},
From 5a80c068bd7cd42e84b1a95fdc554efa1b8e97c2 Mon Sep 17 00:00:00 2001
From: Daniel Supernault
Date: Mon, 15 Apr 2019 12:32:19 -0600
Subject: [PATCH 38/74] Update PostComponent
---
resources/assets/js/components/PostComponent.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/resources/assets/js/components/PostComponent.vue b/resources/assets/js/components/PostComponent.vue
index eb207c547..5674d1541 100644
--- a/resources/assets/js/components/PostComponent.vue
+++ b/resources/assets/js/components/PostComponent.vue
@@ -119,7 +119,7 @@
+ + {{s.account.username}} + + +
+