diff --git a/public/s/js/comments.js b/public/s/js/comments.js
index ea2c7e6..079e6a4 100644
--- a/public/s/js/comments.js
+++ b/public/s/js/comments.js
@@ -2213,7 +2213,9 @@ class CommentSystem {
? `style="--author-banner: url('/a/${comment.banner_file}'); --author-banner-position: ${comment.banner_position === 'center' ? 'center top' : (comment.banner_position || 'center top')}; --author-banner-size: ${(comment.banner_size && comment.banner_size !== 'cover') ? comment.banner_size : '100% auto'}; --author-banner-repeat: no-repeat;"`
: '';
- return `
${repliesHtml}`;
+ const authorUserId = comment.user_id ?? (comment.username && window.f0ckSession && comment.username.toLowerCase() === (window.f0ckSession.user || '').toLowerCase() ? (window.f0ckSession.id || window.f0ckSession.user_id) : null);
+
+ return `${repliesHtml}`;
}
timeAgo(date) {
@@ -3589,7 +3591,7 @@ class CommentSystem {
files: files,
created_at: json.comment.created_at || new Date().toISOString(),
username: currentUsername,
- user_id: session.id || null,
+ user_id: (json.comment && json.comment.user_id) || session.id || session.user_id || null,
display_name: session.display_name || null,
avatar: resolvedAvatar,
avatar_file: resolvedAvatarFile,
diff --git a/src/inc/routes/comments.mjs b/src/inc/routes/comments.mjs
index 0b71f4a..dedcac2 100644
--- a/src/inc/routes/comments.mjs
+++ b/src/inc/routes/comments.mjs
@@ -70,7 +70,7 @@ export default (router, tpl) => {
comments,
is_subscribed,
is_locked,
- user_id: req.session ? req.session.user : null,
+ user_id: req.session ? req.session.id : null,
is_admin: req.session ? (req.session.admin || req.session.is_moderator) : false
})
})
@@ -664,6 +664,7 @@ export default (router, tpl) => {
success: true,
comment: {
...newComment[0],
+ user_id: req.session.id,
content,
files: activityFiles,
banner_file: bannerOpt.banner_file || req.session.banner_file || null,
diff --git a/views/snippets/footer.html b/views/snippets/footer.html
index b2063ab..a7dc1ec 100644
--- a/views/snippets/footer.html
+++ b/views/snippets/footer.html
@@ -379,6 +379,8 @@
enable_nsfl: @if(enable_nsfl) true @else false @endif,
user: @if(session) "{{ session.user }}" @else null @endif,
display_name: @if(session && session.display_name) "{!! session.display_name !!}" @else null @endif,
+ id: @if(session && session.id) {{ session.id }} @else null @endif,
+ user_id: @if(session && session.id) {{ session.id }} @else null @endif,
is_admin: @if(session && session.admin) true @else false @endif,
is_moderator: @if(session && session.is_moderator) true @else false @endif,
enable_swf: @if(enable_swf) true @else false @endif,