Browse Source

Ensure that reblogs and favs always refer to the original status rather than a reblog wrapper

pull/5/head
Eugen Rochko 9 years ago
parent
commit
3caf0cfb03
  1. 4
      app/models/favourite.rb
  2. 1
      app/models/status.rb

4
app/models/favourite.rb

@ -28,4 +28,8 @@ class Favourite < ApplicationRecord
def target
thread
end
before_validation do
self.status = status.reblog if status.reblog?
end
end

1
app/models/status.rb

@ -160,6 +160,7 @@ class Status < ApplicationRecord
before_validation do
text.strip!
self.reblog = reblog.reblog if reblog? && reblog.reblog?
self.in_reply_to_account_id = thread.account_id if reply?
end
end

Loading…
Cancel
Save