mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Small actions should show descriptions on the user stream
This commit is contained in:
@@ -154,6 +154,7 @@ SQL
|
||||
CASE WHEN coalesce(p.deleted_at, p2.deleted_at, t.deleted_at) IS NULL THEN false ELSE true END deleted,
|
||||
p.hidden,
|
||||
p.post_type,
|
||||
p.action_code,
|
||||
p.edit_reason,
|
||||
t.category_id
|
||||
FROM user_actions as a
|
||||
|
||||
@@ -29,11 +29,11 @@ class UserActionObserver < ActiveRecord::Observer
|
||||
return unless action && post && user && post.id
|
||||
|
||||
row = {
|
||||
action_type: action,
|
||||
user_id: user.id,
|
||||
acting_user_id: acting_user_id || post.user_id,
|
||||
target_topic_id: post.topic_id,
|
||||
target_post_id: post.id
|
||||
action_type: action,
|
||||
user_id: user.id,
|
||||
acting_user_id: acting_user_id || post.user_id,
|
||||
target_topic_id: post.topic_id,
|
||||
target_post_id: post.id
|
||||
}
|
||||
|
||||
if post.deleted_at.nil?
|
||||
@@ -48,12 +48,12 @@ class UserActionObserver < ActiveRecord::Observer
|
||||
return if model.is_first_post?
|
||||
|
||||
row = {
|
||||
action_type: UserAction::REPLY,
|
||||
user_id: model.user_id,
|
||||
acting_user_id: model.user_id,
|
||||
target_post_id: model.id,
|
||||
target_topic_id: model.topic_id,
|
||||
created_at: model.created_at
|
||||
action_type: UserAction::REPLY,
|
||||
user_id: model.user_id,
|
||||
acting_user_id: model.user_id,
|
||||
target_post_id: model.id,
|
||||
target_topic_id: model.topic_id,
|
||||
created_at: model.created_at
|
||||
}
|
||||
|
||||
rows = [row]
|
||||
@@ -79,12 +79,12 @@ class UserActionObserver < ActiveRecord::Observer
|
||||
|
||||
def log_topic(model)
|
||||
row = {
|
||||
action_type: model.archetype == Archetype.private_message ? UserAction::NEW_PRIVATE_MESSAGE : UserAction::NEW_TOPIC,
|
||||
user_id: model.user_id,
|
||||
acting_user_id: model.user_id,
|
||||
target_topic_id: model.id,
|
||||
target_post_id: -1,
|
||||
created_at: model.created_at
|
||||
action_type: model.archetype == Archetype.private_message ? UserAction::NEW_PRIVATE_MESSAGE : UserAction::NEW_TOPIC,
|
||||
user_id: model.user_id,
|
||||
acting_user_id: model.user_id,
|
||||
target_topic_id: model.id,
|
||||
target_post_id: -1,
|
||||
created_at: model.created_at
|
||||
}
|
||||
|
||||
rows = [row]
|
||||
|
||||
Reference in New Issue
Block a user