Commit Graph

8768 Commits

Author SHA1 Message Date
evazion
95e424ad80 views: remove unused artists/banned template. 2020-01-25 01:33:21 -06:00
evazion
ec163f96a8 posts: remove unused appeal! method. 2020-01-24 23:51:37 -06:00
evazion
a3e16c167f posts: remove unused undelete! method. 2020-01-24 04:08:56 -06:00
evazion
fcb6f96979 forum: add /forum_topic_visits.{json,xml} endpoint.
For debugging purposes only.
2020-01-22 21:30:00 -06:00
evazion
cc96f30e47 forum: fix topics being incorrectly marked as unread (again).
Second attempt at 71690cacc. Fix topics on page 2+ being still marked as
unread after the user has marked all topics as read.
2020-01-22 21:09:32 -06:00
evazion
22cb0ea322 models: replace raw LIKE queries with where_like. 2020-01-22 13:21:31 -06:00
evazion
9d71c77524 autocomplete: fix favgroup:<name> returning favgroups for other users.
* Fix favgroup:<name> autocompletion to only return favgroups for the
  current user.
* Add favgroup autocomplete to the /favorite_groups search form.
2020-01-22 11:21:16 -06:00
evazion
edaf6323fd /favorite_groups: add search, creators, timestamps, edit/delete links. 2020-01-22 02:03:19 -06:00
evazion
1aadd19663 BURs: fix broken [bur:<id>] links in forum posts.
Fix bulk update requests generating invalid [bur:<id>] links in forum
posts. The id was missing because the BUR created the forum topic in a
before_create hook, which created the post before the BUR was saved so
the BUR didn't have an id yet. Fix regression caused by b4ce2d83.
2020-01-21 19:56:04 -06:00
evazion
0a3d038df9 autocomplete: fix broken wiki page autocomplete.
Fix breakage from 34368272e.
2020-01-21 18:44:02 -06:00
evazion
20b2c28126 posts/show: fix tag search in navbar not being bolded. 2020-01-21 17:30:57 -06:00
evazion
60bf21ff80 twitter: fix preview_urls when source url is a direct image.
Fix preview_urls returning an empty array when the source url is a
direct image from Twitter.

Also return preview_urls in /source.json.
2020-01-21 16:34:03 -06:00
evazion
b60d988790 diff builder: fix bug in wiki page / pool diff generation.
Fixup for c2688e3af.
2020-01-21 15:02:02 -06:00
evazion
71690cacc1 forum: fix topics being incorrectly marked as unread.
This happened when the user marked all topics as read and so didn't have
any forum topic visits. The OR clause wasn't handled correctly for this
case.
2020-01-21 14:31:26 -06:00
evazion
c7b30279b3 mod reports: temp hide ability to create reports.
Temp disable creating reports until we're ready to roll it out all the way.
2020-01-21 11:25:30 -06:00
evazion
c1f2cd8d9d Update ruby gems. 2020-01-21 01:06:45 -06:00
evazion
8881edaf9f post replacements: fix dialog submit not working. 2020-01-21 00:54:07 -06:00
evazion
f2f236c23a mod reports: remove use of belongs_to_creator macro.
Remove use of belongs_to_creator macro as per b4ce2d83a.
2020-01-21 00:25:29 -06:00
evazion
b5603f0d39 forum: optimize unread forum topics on forum index.
Avoid doing one SQL query per topic when checking for new topics on the
forum index.

This also changes it so that forum topics aren't always marked as new
for anonymous users.
2020-01-21 00:12:03 -06:00
evazion
71cf1f65be forum: fix exception when viewing empty forum topics.
* https://danbooru.donmai.us/forum_topics?search[response_count]=0&search[is_deleted]=true
* https://danbooru.donmai.us/forum_topics/11313
2020-01-21 00:11:12 -06:00
evazion
cca3f98765 forum: remove ability to merge forum topics.
* Rarely used (only used ~15 times in total, not used at all since 2015-2016).
* Merging topics didn't properly bump the new topic.
* Merging topics didn't log a modaction when the old topic was deleted.
* Merging topics broke the old topic. Moving all the posts from one topic
  to another leaves the old topic with zero posts. This normally can't
  happen and it causes exceptions when you try to view the empty topic.
* It was technically possible to merge a topic with itself. This would
  break the response_count.
* It was technically possible for a mod to merge a topic into an
  admin-only topic.
2020-01-21 00:10:21 -06:00
evazion
13528ac2d3 Drop forum subscriptions.
Few people used forum subscriptions (only around 100), and even fewer
people were subscribed to active threads. Most subscriptions were for
old threads that will never be bumped again. The implementation also had
a few problems:

* Unsubscribe links in emails didn't work (they unset the user's
  receive_email_notifications flag, but forum subscriptions didn't
  respect this flag).
* Some users had invalid email addresses, which caused notifications to
  bounce. There was no mechanism for preventing bounces.
* The implementation wasn't scalable. It involved a daily linear scan
  over _all_ forum subscriptions looking for any topics that had been updated.
2020-01-21 00:10:21 -06:00
evazion
cae9a5d7e3 Drop dmail filters.
Few people used dmail filters (~900 users in 5 years) and even fewer
used them correctly. Most people used them to try to block dmail spam,
but usually they either blocked too much (by adding common words that
are present in nearly all dmails, causing all mails to them to be
filtered) or too little (blocking specific email addresses or urls,
which usually are never seen again after the spammer is banned).
Nowadays the spam detection system does a better job of filtering spam.
2020-01-21 00:10:20 -06:00
evazion
c2688e3aff Fix #4263: Wiki page differences use the wrong order.
Standardize DiffBuilder to treat the first argument as the new item and
the second argument as the old item. This is the order used in most
other places.
2020-01-21 00:09:38 -06:00
evazion
b62cdc4cfe test: move test/models/* to test/unit/*. 2020-01-21 00:09:38 -06:00
evazion
79015b4341 tests: fix various broken tests. 2020-01-21 00:09:38 -06:00
evazion
cbbeac00df /saved_searches: fix duplicate input_html in label field. 2020-01-21 00:09:38 -06:00
evazion
b4ce2d83a6 models: remove belongs_to_creator macro.
The belongs_to_creator macro was used to initialize the creator_id field
to the CurrentUser. This made tests complicated because it meant you had
to create and set the current user every time you wanted to create an
object, when lead to the current user being set over and over again. It
also meant you had to constantly be aware of what the CurrentUser was in
many different contexts, which was often confusing. Setting creators
explicitly simplifies everything greatly.
2020-01-21 00:09:38 -06:00
evazion
77bf9ac7f3 Merge pull request #4267 from BrokenEagle/add-report-function
Create the ability to send reports to moderators
2020-01-21 00:08:31 -06:00
BrokenEagle
5f746c1a34 Made recommended changes to moderator reports (see #4267) 2020-01-21 01:38:08 +00:00
evazion
1104f87b1f Merge pull request #4268 from BrokenEagle/universal-array-parameters
Add ability to search for multiple name values on the same field
2020-01-20 16:35:45 -06:00
BrokenEagle
34368272e8 Added ability to search for URL array parameters
- Also added in different string splitters for the text fields
- Removed or renamed parameters covered by the main search function
2020-01-19 23:59:23 +00:00
BrokenEagle
29e8b89c93 Use better method for querying moderation reports on posts and topics
- Also moved the control logic out of the views and into the models
2020-01-19 20:16:22 +00:00
BrokenEagle
16100ecfe6 Use better method of querying the moderation reports for an instance
The use of any? and count was forcing new SQL requests for each statement.
Instead, present? and length were used which act on the reports once loaded.
Although unneeded, the comment and forum views were changed as well for consistency.
2020-01-19 00:09:51 +00:00
BrokenEagle
f3ce811def Add tests for moderation reports
Added an HTML render for the new endpoint to get the tests to work.
It should probably have had one anyways so this is alright.
2020-01-18 23:37:58 +00:00
BrokenEagle
491d476456 Add pruning of reports older than a week 2020-01-18 21:42:31 +00:00
BrokenEagle
a3e889bdf5 Added highlighting and notices for moderators
- Posts and topics have an added moderation_reports function
-- This is so all moderation reports can be loaded in a single query
- Those moderation reports are passed into the render functions separately
-- This is so the individual comments/posts don't have to be queried
2020-01-18 21:10:50 +00:00
BrokenEagle
4cef0e45c2 Create the ability to send reports to moderators
- Limited to Builders+
-- Moderator+ can also use as they may be too busy ATM
- Only on users, comments, and forum posts
- Multiple reports can be generated per instance
- Primarily posts to a moderator-only topic for viewability
- Secondarily has a table for searchability
-- Viewable only by moderators
2020-01-18 06:40:20 +00:00
evazion
4a7322b197 users: rework privacy mode into private favorites (fix #4257).
* Rename 'privacy mode' to 'private favorites'.
* Make the private favorites setting only hide favorites, not favgroups
  and not the user's uploads on their profile page.
* Make the favgroup is_public flag default to true instead of false and
  fix existing favgroups to be public if the user didn't have privacy mode
  enabled before.
* List _all_ public favgroups on the /favorite_groups index, not just
  favgroups belonging to the current user.
* Add a /users/<id>/favorite_groups endpoint.
2020-01-17 22:24:29 -06:00
evazion
2095dd3084 users: refactor bit_prefs search. 2020-01-17 22:13:12 -06:00
evazion
b7350b8fe0 tests: fix various broken tests. 2020-01-17 19:21:20 -06:00
evazion
20f893161b favgroups: optimize favgroup:<name> search metatag.
The previous method resulted in a `WHERE posts.id IN (<list of ids>)`
clause, which turned into a huge list when the favgroup had a lot of
posts.
2020-01-17 13:38:51 -06:00
evazion
e6ffdfdf81 favgroups: unify find by name methods.
Unify the `name_to_id`, `named`, and `find_by_name` methods into a
single `find_by_name_or_id` method that has consistent behavior in how
names are normalized.
2020-01-17 13:37:18 -06:00
evazion
d461bb2ad0 post sets: refactor pool/favgroup methods.
Eliminate the `has_pool?` and `pool_name` methods in favor of the `pool`
method. Likewise for favgroups.
2020-01-17 02:16:13 -06:00
evazion
d16756f186 post sets: remove unused methods. 2020-01-17 01:36:51 -06:00
evazion
9bce0b3743 post sets: eliminate PostSets::Base class. 2020-01-17 01:12:16 -06:00
evazion
ed75db8d93 Merge pull request #4266 from BrokenEagle/fix-missing-blank-message
Remove posts not shown for blank message check
2020-01-17 01:08:32 -06:00
BrokenEagle
b2d12e2e20 Remove posts not shown for blank message check 2020-01-17 07:01:16 +00:00
evazion
9ec30c85cf favgroups: prevent adding invalid posts to favgroups.
Prevent adding duplicate or nonexistent posts to favgroups. This was
possible by editing the post_ids field directly on the favgroup edit
page.
2020-01-17 00:19:23 -06:00
evazion
ab325c5d2b favgroups: convert post_ids from string to array. 2020-01-17 00:19:20 -06:00