Commit Graph
795 Commits
Author SHA1 Message Date
Albert Yi f8f353da0c Merge pull request #3427 from evazion/feat-autoban-spammers
Fix #3408: More automated measures against spammers
2017-12-15 17:48:22 -08:00
r888888888 b5d72ae8d8 fixes #3422 2017-12-15 17:21:33 -08:00
evazion 002b5e385a Autoban dmail spambots (#3408).
If a user sends spam to more than 10 users within a 24 hour window,
automatically ban them for 3 days.
2017-12-15 19:14:27 -06:00
evazion e2eb45a5a3 Auto-promote DanbooruBot to Mod. Auto-create DanbooruBot if it doesn't exist. 2017-12-15 18:54:18 -06:00
evazion b48211cd4a dmails: only spam check recipient's copy of the dmail.
Each dmail creates two copies, one for the sender and one for the
receiver. Only spam check the receiver's copy.

Prevents senders from being able to tell when their messages are being
spam filtered.
2017-12-15 18:54:18 -06:00
evazion 4c39783d28 Fix #3424: /iqdb_queries.json fails for certain urls.
Fix the HTML page -> image URL download rewrite strategy failing for
https://lohas.nicoseiga.jp/thumb/${id}i URLs.
2017-12-15 10:16:06 -06:00
Albert Yi 8d5f1bccaf Merge pull request #3403 from evazion/fix-favgroup-race
Fix race condition when adding posts to favgroups
2017-12-13 14:28:38 -08:00
Albert Yi 42454dddcb Merge pull request #3402 from evazion/fix-3039
Fix test failures under ruby 2.4
2017-12-13 14:28:25 -08:00
Albert Yi 1d901e9307 Merge pull request #3357 from evazion/feat-soft-post-validations
Post editing: add warning when creating new tags (#3352)
2017-12-13 14:24:51 -08:00
evazion 5819afced7 Fix #3412: Mass updates incorrectly move saved searches. 2017-12-06 14:46:12 -06:00
evazion d6d73404a9 Apply aliases to characters in <character>_(cosplay) tags (#3409). 2017-12-06 12:47:27 -06:00
evazion acd49be4cc Fix #3419: Deleting a post doesn't clear parent's "parent" status.
Bug: when deleting a child post and the "Move favorites to parent?" option is
set, the parent's has_active_children flag is not cleared.

`give_favorites_to_parent` moves the votes, and moving the votes has the
side effect of reloading the post (to get the new score). But reloading
the post wipes out the is_deleted_changed? flag, which is used by `update_parent_on_save`.

Fix: update the `is_deleted` flag *before* moving favorites, so that the
`update_parent_on_save` callback runs before `give_favorite_to_parent` runs.
2017-12-05 19:35:15 -06:00
evazion feb3ec0750 Fix #3417: Deleting a user's comment credits the change to them. 2017-12-02 19:41:37 -06:00
evazion 3c6a613964 Fix #3410: Unable to create a new wiki page.
Fix `Post.fast_count(nil)` failing when the user had the "safe mode" or
"deleted post filter" options turned on.
2017-11-29 12:34:07 -06:00
evazion 4939c0345a Fix test failures when removing posts from deleted pools.
These tests failed because removing posts from deleted pools is now
Builder-only.
2017-11-26 18:10:08 -06:00
evazion a7566ae851 post_view_count_service_test.rb: fix test failure. 2017-11-26 16:17:21 -06:00
evazion 255082d3b5 tumblr: fix test failure. 2017-11-26 15:37:51 -06:00
evazion 80e115b600 favgroups: fix race condition when adding posts to favgroups.
Adding or removing a post id to a favgroup's post_ids string is
non-atomic. Lock it to prevent simultaneous updates to the same favgroup
from clobbering each other.

Same bug as #3091.
2017-11-26 11:02:39 -06:00
evazion bc3e2438d9 posts: add tests for warning validations. 2017-11-25 17:03:33 -06:00
r888888888 060762defa add service for purging files from cloudflare cache 2017-11-22 13:19:30 -08:00
evazion 0b5ed163fe Fix #3395: fix pixiv API exception when uploading bad pixiv id images.
Fixes an exception when attempting to upload a Pixiv image from a
deleted work. The download strategy tries to fetch the source data in
the course of rewriting the URL, which fails if the work has been
deleted from Pixiv.

Raise a BadIDError and leave the URL as-is (don't rewrite it).
2017-11-21 14:40:39 -06:00
evazion 5ba63733d3 download/pixiv_test.rb: fix broken pixiv download tests.
This post was deleted:

  http://www.pixiv.net/member_illust.php?mode=medium&illust_id=46304614

Switch to this instead:

  http://www.pixiv.net/member_illust.php?mode=medium&illust_id=46324488
2017-11-21 13:48:07 -06:00
evazion a14c492020 Fix #3396: Pixiv novel cover IDs are parsed incorrectly. 2017-11-21 13:03:03 -06:00
Albert Yi 051c17953d Merge pull request #3393 from evazion/feat-safe-mode
Fix #3392: Add safe mode account setting.
2017-11-21 10:55:57 -08:00
evazion f8581c8113 Fix #3321: HTML tags not converted in artist commentaries. 2017-11-21 02:42:49 -06:00
evazion b3a9cd6c06 Fix Post.fast_count("pool:1537") == 0 (fixup 134958d1).
Fixup for a bug in 134958d1. `Post.fast_count("pool:1537")` still
returned zero because `Tag.is_simple_tag?` incorrectly parsed
"pool:1537" as a simple tag, so Post.fast_count still looked for it in
the tags table and found the empty "pool:1537" tag.
2017-11-20 21:21:36 -06:00
evazion df7648b581 Fix #3392: Add safe mode account setting. 2017-11-20 18:59:53 -06:00
r888888888 502f1298a9 fix unit tests 2017-11-20 16:30:07 -08:00
Albert Yi f11992bd91 Merge pull request #3391 from evazion/fix-3390
Fix #3390: Searching certain metatags results in an empty paginator
2017-11-20 14:23:27 -08:00
evazion 134958d137 Fix #3390: Searching certain metatags results in an empty paginator
Fixes Post#get_count_from_cache to only lookup the count in the tags
table when the search is for a single "simple" tag.

Check memcache when the search is not a simple tag:

* multi-tag searches (touhou rating:s)
* single metatag searches (rating:s, source:"foo bar")
* negated tags (-touhou)
* wildcard tags (*touhou*)
* or searches (~touhou)
2017-11-20 14:41:02 -06:00
r888888888 9d5e4f969f fix source tests 2017-11-20 12:30:29 -08:00
Albert Yi e21f7c14db Merge pull request #3389 from evazion/fix-3387
Fix #3387: Safebooru: Two tag searches fail for members.
2017-11-20 11:39:50 -08:00
evazion 9b887c3c3a Fix #3387: Safebooru: Two tag searches fail for members.
Makes the `rating:s` and `-status:deleted` tags not count against the
tag limit.
2017-11-19 20:58:22 -06:00
evazion 40d0751e83 Fix NoStrategyError during artist url normalization (#3382).
Fixes a bug from 9a3824a. When an artist entry is saved, `ArtistUrl.normalize`
is called on every URL, which calls `Sources::Site.new(url)`. This
raised NoStrategyError when an artist entry contained URLs that weren't
recognized by any strategy.

This also caused `Fetch source data` to fail in certain cases when it
attempted to find the artist.
2017-11-19 10:49:30 -06:00
evazion 2422ce036c tumblr_test.rb: fix test failures. 2017-11-18 13:52:30 -06:00
evazion 22c9cfcec5 Fix #3384: Fetch commentary not creating fully formed textile links 2017-11-18 13:02:50 -06:00
evazion 6b8bc318b5 deviantart_test.rb: fix test failures. 2017-11-18 13:00:18 -06:00
r888888888 3c524aa5e6 fix bug with source::site 2017-11-17 17:26:33 -08:00
r888888888 e70c2a3085 remove references to tag subscriptions 2017-11-17 13:45:17 -08:00
evazion 26679dd7ab Fix #3323: Exclude post replacements from Mod Actions. 2017-11-17 13:21:36 -06:00
evazion 93767c3023 Fix post replacement test failure. 2017-11-17 13:21:35 -06:00
evazion 07d20f7cf0 Add test for category <tag> -> type bulk update requests. 2017-11-17 12:15:38 -06:00
r888888888 5726bc43dd add test for PostViewCountService 2017-11-16 16:27:52 -08:00
r888888888 3ad332ad3d fix post test 2017-11-16 14:20:32 -08:00
r888888888 73f257ec63 disable manual post count expiration, rely solely on timed expiries (fixes #3376) 2017-11-16 13:43:38 -08:00
Albert Yi 058783755d Merge pull request #3379 from evazion/fix-3377
Fix #3377: Batch bookmarklet doesn't fetch artist/tags from twitter
2017-11-16 12:02:06 -08:00
r888888888 2e0534a66b fixes #3372 2017-11-16 12:00:54 -08:00
r888888888 2c620f205b add tests to check if approver/rejector is mentioned in moderated bulk update requests 2017-11-16 11:41:07 -08:00
evazion f633222ef0 twitter: test fetching source data from direct image with referer. 2017-11-16 13:29:58 -06:00
r888888888 cd5d9cdaeb update twitter test 2017-11-16 11:19:39 -08:00