belongs_to :account, inverse_of: :favourites
belongs_to :status, inverse_of: :favourites
- has_one :stream_entry, as: :activity, dependent: :destroy
+ has_one :stream_entry, as: :activity
def verb
:favorite
belongs_to :account
belongs_to :target_account, class_name: 'Account'
- has_one :stream_entry, as: :activity, dependent: :destroy
+ has_one :stream_entry, as: :activity
validates :account, :target_account, presence: true
validates :account_id, uniqueness: { scope: :target_account_id }
if salmon.verify(envelope, account.keypair)
update_remote_profile_service.(xml.at_xpath('/xmlns:entry/xmlns:author'), account)
+ binding.pry
+
case verb(xml)
when :follow
follow!(account, target_account)
end
def verb(xml)
- xml.at_xpath('//activity:verb').content.gsub('http://activitystrea.ms/schema/1.0/', '').to_sym
+ xml.at_xpath('//activity:verb').content.gsub('http://activitystrea.ms/schema/1.0/', '').gsub('http://ostatus.org/schema/1.0/', '').to_sym
rescue
:post
end