File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -40,19 +40,24 @@ module ::CommunityCustomFields
4040 end
4141
4242 on ( :topic_created ) do |topic , _opts , user |
43- next unless topic . archetype == "regular" && user . id > 0
43+ next if topic . archetype != "regular"
44+ next if user . id < 0
4445
4546 topic . custom_fields [ :status ] = "new"
46- topic . custom_fields [ :waiting_since ] = Time . now . utc . iso8601
47- topic . custom_fields [ :waiting_id ] = user . id
47+
48+ if ( !user . admin ) {
49+ topic . custom_fields [ :waiting_since ] = Time . now . utc . iso8601
50+ topic . custom_fields [ :waiting_id ] = user . id
51+ }
52+
4853 topic . save_custom_fields
4954 end
5055
5156 on ( :post_created ) do |post , _opts , user |
52- next unless post . archetype == "regular"
53- next unless post . post_type == 1
54- next if post . post_number == 1
57+ next if post . archetype != "regular"
5558 next if user . id < 0
59+ next if post . post_type != 1
60+ next if post . post_number == 1
5661
5762 topic = post . topic
5863
You can’t perform that action at this time.
0 commit comments