FEATURE: adjust autobump system

- We spread out bumping through the day, if you are bumping
 4 topics then a topic will be bumped every 6 hours

- We add a small, bumping action at the bottom of the post to
 denote a topic got bumped
This commit is contained in:
Sam
2018-07-18 10:17:33 +10:00
parent f146f94ef6
commit 02628883d2
4 changed files with 31 additions and 12 deletions

View File

@@ -698,10 +698,16 @@ class Topic < ActiveRecord::Base
true
end
def add_small_action(user, action_code, who = nil)
def add_small_action(user, action_code, who = nil, opts = {})
custom_fields = {}
custom_fields["action_code_who"] = who if who.present?
add_moderator_post(user, nil, post_type: Post.types[:small_action], action_code: action_code, custom_fields: custom_fields)
opts = opts.merge(
post_type: Post.types[:small_action],
action_code: action_code,
custom_fields: custom_fields
)
add_moderator_post(user, nil, opts)
end
def add_moderator_post(user, text, opts = nil)