Commit Graph

5356 Commits

Author SHA1 Message Date
evazion
59bb705307 Gemfile.lock: update awesome_print to 1.7.0. 2017-02-28 00:11:25 -06:00
evazion
822d881096 Gemfile.lock: update pry-byebug to 3.4.2. 2017-02-28 00:11:25 -06:00
evazion
bdbf54aef7 Gemfile: remove unused gems.
coffee-rails and daemons are unused.

kgio, net-ssh, and nokogiri are pulled in by other gems, but they aren't
used by us directly, so they shouldn't need to be listed in the Gemfile.
2017-02-28 00:11:25 -06:00
evazion
615e4bbebd Gemfile: move test group to bottom. 2017-02-28 00:11:25 -06:00
r888888888
02fc06764d update dtext gem 2017-02-27 17:03:13 -08:00
Albert Yi
d406a9e472 Merge pull request #2899 from evazion/fix-mention-dmails
Send @mention dmails from DanbooruBot
2017-02-27 17:01:09 -08:00
Albert Yi
fd7cddc909 Merge branch 'master' into fix-mention-dmails 2017-02-27 17:00:24 -08:00
r888888888
80f439f075 fixes #2898: Wiki Page Versions still not recording "is_deleted" 2017-02-27 16:57:24 -08:00
Albert Yi
3780645cb2 Merge pull request #2897 from evazion/fix-rescue_from
Remove redundant rescue_from calls.
2017-02-27 16:48:44 -08:00
Albert Yi
1fa0aabbe0 Merge pull request #2896 from evazion/fix-username-whitespace
Disallow unicode whitespace in usernames (#2894).
2017-02-27 16:47:44 -08:00
Albert Yi
27a85cd066 Merge pull request #2895 from evazion/fix-modqueue-dtext
modqueue: link tags, optimize sql, use dtext in disapproval reasons.
2017-02-27 16:47:19 -08:00
r888888888
b332273378 fixes #2892: after_destroy callbacks should be fired upon comment deletion 2017-02-27 16:45:51 -08:00
r888888888
a90a1bd895 fix boolean checks in postarchive 2017-02-27 15:41:45 -08:00
r888888888
16cd879e08 potential fix for #2900: Post Versions JSON API failure - undefined method join 2017-02-27 15:22:15 -08:00
r888888888
398f58684f Merge branch 'post-archive' 2017-02-27 10:45:13 -08:00
evazion
46280f2227 mentions: include mentioner in subject line.
The template looks like this:

Subject:

    #{creator_name} mentioned you in a comment on post ##{post_id}

Body:

    @#{creator_name} mentioned you in a \"comment\":/posts/#{post_id}#comment-#{id} on post ##{post_id}:

    [quote]
    #{DText.excerpt(body, "@"+user_name)}
    [/quote]
2017-02-25 23:05:44 -06:00
evazion
6994231801 mentions: send dmails from DanbooruBot. 2017-02-25 23:05:44 -06:00
evazion
6e3ddb6ed6 dmails: don't save copies of outgoing dmails sent by DanbooruBot.
There's not much sense in saving copies of everything DanbooruBot sends
in DanbooruBot's inbox. They probably won't be checked so it just bloats
the dmails table.
2017-02-25 23:05:44 -06:00
evazion
40092f21ba Remove redundant rescue_from calls.
These are redundant because ApplicationController rescues these exceptions already.
2017-02-25 02:18:16 -06:00
evazion
6966b74e18 Disallow unicode whitespace in usernames (#2894). 2017-02-25 01:51:33 -06:00
evazion
b80976bce7 modqueue: link tags, like they are in /comments. 2017-02-24 21:03:14 -06:00
evazion
83915a5d46 modqueue: avoid N+1 queries for disapprovals, uploaders.
Fixes an N+1 queries problem in the /moderator/post/queue view by
prefetching disapprovals and uploaders.

Also the way disapproval messages were previously rendered triggered a bunch
of sql queries for each post:

    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 [["post_id", 52]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND "post_disapprovals"."reason" = $2  [["post_id", 52], ["reason", "breaks_rules"]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND "post_disapprovals"."reason" = $2  [["post_id", 52], ["reason", "poor_quality"]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND "post_disapprovals"."reason" IN ('disinterest', 'legacy')  [["post_id", 52]]
    SELECT COUNT(*) FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND (message is not null and message <> '')  [["post_id", 52]]
    SELECT "post_disapprovals".* FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1 AND (message is not null and message <> '')  [["post_id", 52]]

This refactors to bring it down to one:

    SELECT "post_disapprovals".* FROM "post_disapprovals" WHERE "post_disapprovals"."post_id" = $1  [["post_id", 52]]
2017-02-24 21:03:14 -06:00
evazion
9b40016895 /posts/NNN, modqueue: allow dtext in disapproval reasons. 2017-02-24 21:03:14 -06:00
r888888888
2ebdfd7ab3 add s3 methods to amazonbackup 2017-02-24 14:00:59 -08:00
r888888888
8a57d38f38 remove statement about responding in automated messages 2017-02-24 10:36:45 -08:00
Albert Yi
4d87ac028b Merge pull request #2893 from evazion/fix-automated-dmails
Send automated dmails from DanbooruBot
2017-02-24 10:19:16 -08:00
evazion
6704e71377 dmails: add tests for automated dmails. 2017-02-23 22:51:17 -06:00
evazion
b1af644f67 dmails: send automated dmails from Danbooru.config.system_user.
Sends automated dmails from `Danbooru.config.system_user`, rather than
whichever user is performing the action happens to be (usually User.admins.first).

Also adds a notice in the view that the dmail was automated.
2017-02-23 22:51:17 -06:00
evazion
1400f64338 dmails_controller.rb: convert to strong params. 2017-02-23 22:51:17 -06:00
evazion
0c4b687880 user_name_change_requests.rb: remove unused notify_admins callback. 2017-02-23 22:51:17 -06:00
evazion
865211b0b5 dmails: remove unused edit template and update route. 2017-02-23 22:51:17 -06:00
evazion
2d8a7ed93b /dmails: add help:dmail link to subnavbar. 2017-02-23 22:51:17 -06:00
evazion
d852f98e4f /dmails: remove unused search[owner_id] param.
/dmails is restricted to viewing dmails for CurrentUser only (due to
Dmail.visible in the index action). Remove owner_id from subnavbar links
in /dmails, and don't support it in /dmails?search[owner_id], since it
doesn't actually do anything.

Also removes related dead methods and fixes tests that didn't test owner_id properly.
2017-02-23 22:51:17 -06:00
evazion
6de350cd7d dmail.rb: remove dead new_blank method. 2017-02-23 22:51:17 -06:00
evazion
35bf995276 dmail.rb: make to_name= use User.name_to_id cache. 2017-02-23 22:51:17 -06:00
evazion
2736d31c67 dmail.rb: validate only on creation.
to/from/title/body don't need to be revalidated after creation since
they never change.
2017-02-23 22:51:16 -06:00
r888888888
851872f104 fix site map 2017-02-21 16:41:35 -08:00
r888888888
6bd03ee4db fix tests 2017-02-21 15:04:55 -08:00
r888888888
e699684c61 add css for highliting a specific forum post 2017-02-21 13:40:52 -08:00
Albert Yi
5404c1d231 implement postarchive 2017-02-21 13:40:52 -08:00
r888888888
6c9d5e4f9a remove advertisement code 2017-02-21 13:35:22 -08:00
r888888888
f4d9f76646 remove contributors report 2017-02-21 13:12:43 -08:00
r888888888
ce20a5b36a remove janitor trial report 2017-02-21 13:10:38 -08:00
r888888888
359f48d871 remove user promotions report 2017-02-21 13:09:43 -08:00
r888888888
6ca83a2f3c fixes #2890: Danbooru account upgrades reset permissions 2017-02-21 12:39:45 -08:00
r888888888
176510909a fixes #2891: Banned artists still show up in search listings 2017-02-21 11:34:01 -08:00
Albert Yi
8f49300187 Merge pull request #2889 from evazion/fix-dmail-indexes
Dmails: add indexes on is_read and is_deleted (fix #2886)
2017-02-21 11:31:20 -08:00
Albert Yi
263234be53 Merge pull request #2888 from evazion/fix-dtext-email-links
Fix: Incorrect Relative Links for User Feedbacks #2887
2017-02-21 11:30:50 -08:00
r888888888
532614c5b1 update dtext gem 2017-02-21 11:29:46 -08:00
evazion
abae71c060 layouts/default.html.erb: optimize dmail notice sql.
* CurrentUser.dmail_count caused an unnecessary COUNT(*).
* CurrentUser.dmails.unread.present? caused *all* unread dmails to be
  loaded. We want to only load the first one.
2017-02-18 05:54:46 -06:00