Commit Graph

181 Commits

Author SHA1 Message Date
Sam c1ecd6f4ce update annotations 2015-09-18 10:41:10 +10:00
Régis Hanol faf4f44776 FEATURE: make pin expiration mandatory 2015-07-29 16:34:21 +02:00
Robin Ward bb93a345eb UX: Use smaller messages for moderator actions. 2015-07-27 10:09:21 -04:00
Sam 1edb5919fa PERF: don't count all likes twice on like 2015-06-25 17:19:32 +10:00
Régis Hanol f18098fd9b FEATURE: category dropdown in admin reports 2015-06-24 15:19:39 +02:00
Sam 803feefd54 MessageBus handles readonly redis now, no need to wrap it 2015-05-04 12:21:00 +10:00
Robin Ward 5b3f99aa50 Don't blow up if Redis switches to READONLY 2015-04-24 14:37:16 -04:00
Sam 4387e05162 PERF: speed up query 2015-04-16 17:29:37 +10:00
Sam a5b25ad2af FEATURE: scale up likes per day as users increase trust level
tl2 = 1.5 times the likes
tl3 = 2 times the likes
tl4 = 3 times the likes

configurable via tl[234]_additional_likes_per_day_multiplier site setting
2015-04-16 09:44:30 +10:00
Régis Hanol eec1921ba9 FIX: notifications inconsistencies + never notify system user 2015-04-01 11:55:59 +02:00
Régis Hanol df7c38dd51 FIX: don't add an automated message when *a* moderator already replied (as opposed to *the* moderator) 2015-03-16 12:02:34 +01:00
Régis Hanol afd2417945 FEATURE: new 'auto_respond_to_flag_actions' site setting 2015-03-11 19:29:09 +01:00
Régis Hanol c8631a7a8b FIX: auto-message shouldn't generate notifications 2015-03-11 19:07:17 +01:00
Neil Lalonde a5584f1978 FIX: trying to deleting post with nil topic was failing 2015-03-03 11:52:46 -05:00
Sam 47aa8f3f97 Merge pull request #3197 from riking/rate-limiter
FIX: Don't expire ratelimits at midnight server time
2015-02-23 16:52:25 +11:00
Régis Hanol 3bcaaf6960 also update changed attributes 2015-02-20 18:33:55 +01:00
Régis Hanol e09e8e0b76 FIX: error when re-bookmarking a topic/post 2015-02-19 16:43:12 +01:00
riking 3c035dce7c FIX: Don't expire ratelimits at midnight server time 2015-02-10 22:45:46 -08:00
Régis Hanol 2fcd199f48 FIX: send a PM to moderators when a post has been flagged as sockpuppet 2015-02-05 19:58:49 +01:00
Régis Hanol 20308ecfd9 fix typo (stupid 🇫🇷) 2015-02-02 21:55:44 +01:00
Robin Ward 06279b5c6a Add a new event for when a post is confirmed as spam 2015-02-02 15:52:21 -05:00
Sam 3347a48275 FEATURE: add liked and bookmarked classes to topic list item rows 2015-01-08 14:35:56 +11:00
Sam ea87f5fd8a FEATURE: support for filter=bookmarked and filter=liked in topic list 2015-01-07 18:20:10 +11:00
Erick Guan 97b3914b70 FIX: use utc time when generate reports; set boundary 2014-12-30 22:43:03 +08:00
Régis Hanol 1353557575 FIX: custom flags not possible on very long topic titles 2014-12-11 19:34:52 +01:00
Régis Hanol 86c4c947a3 FIX: drastically simplify auto-close topic logic
Get rid of this nonsensical maximum-flow algorithm :fired:
2014-12-06 16:29:54 +01:00
Régis Hanol cd170ca548 FEATURE: auto-close topics based on community flags 2014-12-05 19:37:43 +01:00
Sam 6bed4e1bf0 add allowed_ips to api_keys
update annotations
2014-11-20 14:53:15 +11:00
cpradio 626da65339 FIX: TL4 flag on TL0 post as spam, hides the post 2014-11-19 11:26:57 -05:00
Régis Hanol e7f251c105 LOTS of changes to properly handle post/topic revisions
FIX: history revision can now properly be hidden
FIX: PostRevision serializer is now entirely dynamic to properly handle
hidden revisions
FIX: default history modal to "side by side" view on mobile
FIX: properly hiden which revision has been hidden
UX: inline category/user/wiki/post_type changes with the revision
details
FEATURE: new '/posts/:post_id/revisions/latest' endpoint to retrieve
latest revision
UX: do not show the hide/show revision button on mobile (no room for
them)
UX: remove CSS transitions on the buttons in the history modal
FIX: PostRevisor now handles all the changes that might create new
revisions
FIX: PostRevision.ensure_consistency! was wrong due to off by 1
mistake...
refactored topic's callbacks for better readability
extracted 'PostRevisionGuardian'
2014-10-27 22:06:43 +01:00
Régis Hanol 70884d2436 FEATURE: automatically hide posts made by TL0 users when flagged by a TL3 user 2014-10-01 18:53:17 +02:00
Régis Hanol 69400a802f FEATURE: auto-delete any hidden posts that stay hidden for more than 30 days 2014-09-25 19:51:00 +02:00
Robin Ward b04a52676e FIX: Don't show wrong flag choices after undo 2014-09-02 17:37:54 -04:00
Sam 22fbae8556 Merge pull request #2674 from akshaymohite/optimization-fixes
renamed unused variables properly
2014-09-02 08:22:43 +10:00
riking 3396e6fea3 Centralize MessageBus post updates
After this change, only two files directly publish to MessageBus with a
topic interpolated in the channel: Post and TopicUser.
2014-08-28 20:40:36 -07:00
Sam 414c6d191f FIX: remove nullable dates post upgrade to Rails 4 2014-08-27 15:19:25 +10:00
Neil Lalonde 5454c1ed24 Updated model anotations 2014-08-22 13:01:44 -04:00
Akshay 0862a65d4a renamed unused variables properly 2014-08-20 23:44:19 +05:30
Régis Hanol f2b0228164 FIX: unhide post when a moderator undos the flag on which s/he took action 2014-08-19 16:14:17 +02:00
Akshay 9d11ccc42e removed usless access modifiers specified in models 2014-08-19 07:28:21 +05:30
Régis Hanol d7b1313d5e FEATURE: acting on a flag should not post an automated status message if you already replied to it 2014-08-18 17:00:14 +02:00
Sam 9ba8b29e98 FIX: API should return post_action or nil, true is wrong 2014-08-18 12:03:46 +10:00
Akshay 7ef61144e7 Avoid using to_s when performing String Interpolation 2014-08-14 23:55:27 +05:30
Régis Hanol 85570ddc77 TRIVIAL: fix grammar on 'deferred' columns 2014-08-11 11:56:54 +02:00
Régis Hanol 17debbdcda FIX: make sure no more than one 'status' reply is put in a PM (for multiple flags on the same post) 2014-08-04 19:39:36 +02:00
Régis Hanol 2e134742d4 FIX: only show 'defer flags' when there are active flags on the post 2014-08-04 17:29:01 +02:00
Sam e907cca62e annotate 2014-07-31 13:14:40 +10:00
Régis Hanol 220f9e21e3 FIX: 'undo flag' marks the flag as disagreed 2014-07-30 23:35:42 +02:00
Régis Hanol 57fef6864d FIX: update_counters wasn't properly updating topic counters 2014-07-28 22:08:31 +02:00
Régis Hanol bddffa7f9a FEATURE: flag dispositions normalization
All flags should end up in one of the three dispositions
  - Agree
  - Disagree
  - Defer

In the administration area, the *active* flags section displays 4 buttons
  - Agree (hide post + send PM)
  - Disagree
  - Defer
  - Delete

Clicking "Delete" will open a modal that offer to
  - Delete Post & Defer Flags
  - Delete Post & Agree with Flags
  - Delete Spammer (if available)

When the flag has a list associated, the list will now display 1
response and 1 reply and a "show more..." link if there are more in the
conversation. Replying to the conversation will NOT give a disposition.
Moderators must click the buttons that does that.

If someone clicks one buttons, this will add a default moderator message
from that moderator saying what happened.

The *old* flags section now displays the proper dispositions and is
super duper fast (no more N+9999 queries).

FIX: the old list includes deleted topics
FIX: the lists now properly display the topic states (deleted, closed,
archived, hidden, PM)
FIX: flagging a topic that you've already flagged the first post
2014-07-28 19:28:07 +02:00
Sam 0f9678fe49 FIX: faster update of all badges
Introduced badge triggers, introduced concept of badge that happens due to a post but has the post hidden

Delta badge grant happens once a minute, backed by redis
2014-07-23 11:46:07 +10:00
Robin Ward 3aa8d8efa1 FIX: Acting and undoing repeatedly was broken 2014-07-18 16:17:11 -04:00
Robin Ward a2fec165d5 Disable editing of hidden posts within a timeframe from when the post
was initially hidden.
2014-06-20 15:38:03 -04:00
Robin Ward 3811efa5e2 Record when a post was hidden 2014-06-20 15:03:23 -04:00
Vikhyat Korrapati 3ba65af19e Add like-based system badges. 2014-06-19 17:10:43 +05:30
Régis Hanol 0df666277d BUGFIXES: properly deal with bookmarks and deleted posts
BUGFIX: removing a bookmark from the activity feed was busted for deleted posts
BUGFIX: delete associated user actions when deleting a post
2014-06-04 17:41:11 +02:00
Sam b1d5f4440b Annotate models 2014-05-28 12:30:57 +10:00
Régis Hanol 08dde3d881 BUGFIX: moderators can notify moderators 2014-05-13 17:47:00 +02:00
Neil Lalonde e68e97d986 FIX: moderators can't see private topics that they aren't invited to see. 2014-05-12 15:26:46 -04:00
Louis Rose 1574485443 Perform the where(...).first to find_by(...) refactoring.
This refactoring was automated using the command: bundle exec "ruby refactorings/where_dot_first_to_find_by/app.rb"
2014-05-06 14:41:59 +01:00
Régis Hanol 11af466737 FEATURE: add a specific flag reason when a post has been hidden 2014-04-30 16:58:01 +02:00
Erick Guan 6d45f71254 move concerns to the model/concerns 2014-04-19 12:00:40 +08:00
Sam 862a6696c0 Correct annotations
allow longer usernames (up to 60)
2014-04-15 15:53:48 +10:00
Régis Hanol 6373de550f update annotations 2014-04-08 17:35:44 +02:00
Sam 9aec32688b BUGFIX: when RTT is short likes may not appear to work
BUGFIX: site settings db provider not triggering updates
  at the correct point
2014-03-31 12:34:13 +11:00
Sam 1cd32ced33 FEATURE: update likes and flags live. 2014-03-24 13:22:03 +11:00
Neil Lalonde 997a7c676e If flagging a topic with only one post, flag the post instead 2014-02-18 15:18:31 -05:00
Neil Lalonde 6bbc3ec3e0 Add a way to flag a topic 2014-02-12 12:57:55 -05:00
Régis Hanol 37fd7ab574 pull hotlinked images 2013-11-05 19:07:29 +01:00
Sam 641c51367a fix broken build
hack to allow for PMs with no users for flagging needs
2013-09-06 18:03:30 +10:00
Sam 41a1b6942d notify moderators now goes to the "community" user, that saves our poor mods from a flood of pms
if any staff respond to a pm they are automatically added to the list of recipients and will start
getting email notifications
2013-09-06 14:07:23 +10:00
Sam a9393e4a7a paging for flag list
corrected reload behavior on flag list
refactored post actions ... extracted flag queries
2013-08-19 21:14:26 +10:00
Sam ee95d7df9c trigger observers, wow this is all very complicated and full of duct tape 2013-08-15 13:54:48 +10:00
Sam fda6cce0de minor refactor 2013-08-15 13:44:30 +10:00
Neil Lalonde 4fd5087f91 Add button to delete a spammer in the flag modal
Add SiteSettings: delete_user_max_age, delete_all_posts_max. Add delete spammer button to admin flags UI
Moderators can delete users too
2013-07-29 15:29:44 -04:00
Stephan Kaag 0e3b8fbb24 Remove some calls to `all`. They are not required, and Rails4 raises warnings about them. 2013-07-22 20:44:11 +02:00
Robin Ward b7327942af Add `deleted_by` to `Trashable` tables 2013-07-09 15:46:36 -04:00
Stephan Kaag 89b621d31a Refactor update_all statements in order to prevent deprecation warnings in Rails 4 2013-07-02 18:36:47 +02:00
Sam 5d4760f91d ruby 1.9.3 compat ... to_h does not exist there 2013-07-01 12:44:46 +10:00
Sam 4512956c68 don't run the wrong sentinel on message, message is validated in the post, in effect some flags were being rejected incorrectly 2013-06-28 12:14:40 +10:00
Sam 6145e99baa navigate to message fixed, changed to button
added spec to catch this regression in future
2013-06-27 16:59:07 +10:00
Sam 039b4758ac fix 1.9.3 regression, [] does not work on OpenStruct there. 2013-06-26 21:49:29 +10:00
Sam 48d7a33157 Flag UI now displays deleted status for post/topic correctly on old flags
Commented out a spec that was failing in order random, with a TODO
2013-06-26 16:18:50 +10:00
Sam 65dc04c00e simplify flag reporting and correct it so it properly displays old flags 2013-06-26 15:57:55 +10:00
Amos L King 777e8c2012 Correct spelling of suppress
supress => suppress

Amos King @adkron <amos.l.king@gmail.com>
2013-06-20 23:44:27 -05:00
Sam 4a8a663a67 flagging workflow changes per http://meta.discourse.org/t/we-need-an-archive-flag-notification-button/7450 2013-06-20 17:42:15 +10:00
Régis Hanol 454636abf1 annotate models 2013-06-17 02:49:34 +02:00
Ian Christian Myers 0d01c33482 Enabled strong_parameters across all models/controllers.
All models are now using ActiveModel::ForbiddenAttributesProtection, which shifts the responsibility for parameter whitelisting for mass-assignments from the model to the controller. attr_accessible has been disabled and removed as this functionality replaces that.

The require_parameters method in the ApplicationController has been removed in favor of strong_parameters' #require method.

It is important to note that there is still some refactoring required to get all parameters to pass through #require and #permit so that we can guarantee that parameter values are scalar. Currently strong_parameters, in most cases, is only being utilized to require parameters and to whitelist the few places that do mass-assignments.
2013-06-06 00:30:59 -07:00
Neil Lalonde b55182b983 Use PostDestroyer when deleting all of a user's posts; deleting a post removes its flags and resets its flag counts 2013-06-05 16:05:13 -04:00
Ian Christian Myers f50b648844 Implemented strong_parameters for PostAction/PostActionsController.
PostActionsController now uses strong_parameters' #require to require certain parameters. ActionController::ParameterMissing is now thrown when a reqired parameter is missing, rather than Discourse::InvalidParameters.
2013-06-05 00:23:51 -07:00
Neil Lalonde c4904aacc0 Automatically flag someone as a spammer if their posts get at least X spam flags from N users while their trust level is 'new user'. Staff can clear and set this status from the user record in admin. 2013-06-03 16:37:40 -04:00
Robin Ward 545dbfc07e New Feature: Staff can choose to "Take Action" when flagging to immediately reach hiding
thresholds.
2013-05-31 17:39:32 -04:00
Robin Ward 830b93a16b Reduced complexity of admin flags controller, split up into methods, moved reports into model. 2013-05-29 16:49:34 -04:00
Robin Ward 197909246c Weigh staff likes higher when calculating scores. New site setting: `staff_like_weight`
can set the factor (default is 3)
2013-05-27 12:46:08 -04:00
Sam ca2dee52db moved comments to the bottom, they are way less intrusive there 2013-05-24 12:48:32 +10:00
Sam 2cd95bc649 lets try out annotations 2013-05-24 12:35:14 +10:00
Robin Ward 27828c5ec2 Merge pull request #871 from avdi/refactoring-with-josh-and-avdi
Various refactorings towards Ruby/Rails idiom from Josh Susser and Avdi Grimm
2013-05-21 07:18:50 -07:00
Josh Susser and Avdi Grimm 5659b66729 Refactor select().map() to use pluck.
Remove a method already provided by ActiveRecord.
2013-05-17 15:11:37 -04:00
Robin Ward d554a59102 Support for a new site setting: `newuser_spam_host_threshold`. If a new user posts a link
to the same host enough tiles, they will not be able to post the same link again.

Additionally, the site will flag all their previous posts with links as spam and they will
be instantly hidden via the auto hide workflow.
2013-05-16 12:19:50 -04:00
Sam 9b33e826f2 clear flags on reply to notify moderators 2013-05-13 11:48:01 +10:00