From caf54fe45aa7cba5f3c6bd6a674bbd15b398746d Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 16 Feb 2020 03:51:48 -0600 Subject: [PATCH] blacklists: remove ability for mods to blacklist uploaders by name. --- app/controllers/legacy_controller.rb | 3 +-- app/controllers/posts_controller.rb | 2 +- app/javascript/src/javascripts/blacklists.js | 3 --- app/logical/post_sets/post.rb | 4 ---- app/presenters/post_presenter.rb | 4 ---- 5 files changed, 2 insertions(+), 14 deletions(-) diff --git a/app/controllers/legacy_controller.rb b/app/controllers/legacy_controller.rb index 96220d1d0..5557a3146 100644 --- a/app/controllers/legacy_controller.rb +++ b/app/controllers/legacy_controller.rb @@ -3,8 +3,7 @@ class LegacyController < ApplicationController def posts @post_set = PostSets::Post.new(tag_query, params[:page], params[:limit], format: "json") - @post_set.posts = @post_set.posts.includes(:uploader) - @posts = @post_set.posts.map(&:legacy_attributes) + @posts = @post_set.posts.includes(:uploader).map(&:legacy_attributes) respond_with(@posts) do |format| format.xml do diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb index 9639e65ca..25b21ee64 100644 --- a/app/controllers/posts_controller.rb +++ b/app/controllers/posts_controller.rb @@ -11,7 +11,7 @@ class PostsController < ApplicationController end else @post_set = PostSets::Post.new(tag_query, params[:page], params[:limit], raw: params[:raw], random: params[:random], format: params[:format]) - @posts = @post_set.posts = @post_set.posts.includes(:uploader) if !@post_set.is_random? && CurrentUser.is_moderator? + @posts = @post_set.posts respond_with(@posts) do |format| format.atom end diff --git a/app/javascript/src/javascripts/blacklists.js b/app/javascript/src/javascripts/blacklists.js index 9410cc98f..c9e3c6e1b 100644 --- a/app/javascript/src/javascripts/blacklists.js +++ b/app/javascript/src/javascripts/blacklists.js @@ -152,9 +152,6 @@ Blacklist.post_match = function(post, entry) { var tags = String($post.attr("data-tags")).match(/\S+/g) || []; tags = tags.concat(String($post.attr("data-pools")).match(/\S+/g) || []); tags.push("rating:" + $post.data("rating")); - if ($post.attr("data-uploader")) { - tags.push("user:" + $post.attr("data-uploader").toLowerCase()); - } tags.push("uploaderid:" + $post.attr("data-uploader-id")); $.each(String($post.data("flags")).match(/\S+/g) || [], function(i, v) { tags.push("status:" + v); diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index d6b88b783..918a1c5e4 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -112,10 +112,6 @@ module PostSets end end - def posts=(set_posts) - @posts = set_posts - end - def unknown_post_count? post_count == Danbooru.config.blank_tag_search_fast_count end diff --git a/app/presenters/post_presenter.rb b/app/presenters/post_presenter.rb index 8c4af0d38..ceee28fa5 100644 --- a/app/presenters/post_presenter.rb +++ b/app/presenters/post_presenter.rb @@ -134,10 +134,6 @@ class PostPresenter < Presenter "data-is-favorited" => post.favorited_by?(CurrentUser.user.id) } - if CurrentUser.is_moderator? - attributes["data-uploader"] = post.uploader.name - end - if post.visible? attributes["data-md5"] = post.md5 attributes["data-file-url"] = post.file_url