diff --git a/app/models/favourite.rb b/app/models/favourite.rb index ad5380f438d78fb7ee273587a079fde57ba775ab..20260f46b0016eabde4509ac290d9736cb0a3d5a 100644 --- a/app/models/favourite.rb +++ b/app/models/favourite.rb @@ -2,7 +2,7 @@ class Favourite < ActiveRecord::Base 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 diff --git a/app/models/follow.rb b/app/models/follow.rb index 3521247e834fc5e1ebfcf01f61923e5aabfdba31..e458a07f34822a8320e10a3d2ecaf969a4fd1eda 100644 --- a/app/models/follow.rb +++ b/app/models/follow.rb @@ -2,7 +2,7 @@ class Follow < ActiveRecord::Base 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 } diff --git a/app/services/process_interaction_service.rb b/app/services/process_interaction_service.rb index 30cf5a77146f8227b1634c6c4e2d8a28fe73de12..877647bbe93d429f652c1003611aefaa24206ce0 100644 --- a/app/services/process_interaction_service.rb +++ b/app/services/process_interaction_service.rb @@ -21,6 +21,8 @@ class ProcessInteractionService < BaseService 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) @@ -48,7 +50,7 @@ class ProcessInteractionService < BaseService 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