MS DG; fixed cucumber
This commit is contained in:
parent
10df8ef2c8
commit
df87b398c7
5 changed files with 14 additions and 7 deletions
|
|
@ -12,6 +12,8 @@ class RelayableRetraction < SignedRetraction
|
||||||
super - ['parent_author_signature']
|
super - ['parent_author_signature']
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# @param sender [User]
|
||||||
|
# @param target [Object]
|
||||||
def self.build(sender, target)
|
def self.build(sender, target)
|
||||||
retraction = super
|
retraction = super
|
||||||
retraction.parent_author_signature = retraction.sign_with_key(sender.encryption_key) if defined?(target.parent) && sender.person == target.parent.author
|
retraction.parent_author_signature = retraction.sign_with_key(sender.encryption_key) if defined?(target.parent) && sender.person == target.parent.author
|
||||||
|
|
@ -26,6 +28,10 @@ class RelayableRetraction < SignedRetraction
|
||||||
self.sender_handle
|
self.sender_handle
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def relayable?
|
||||||
|
true
|
||||||
|
end
|
||||||
|
|
||||||
def receive(recipient, sender)
|
def receive(recipient, sender)
|
||||||
if self.target.nil?
|
if self.target.nil?
|
||||||
Rails.logger.info("event=retraction status=abort reason='no post found' sender=#{sender.diaspora_handle} target_guid=#{target_guid}")
|
Rails.logger.info("event=retraction status=abort reason='no post found' sender=#{sender.diaspora_handle} target_guid=#{target_guid}")
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,10 @@ class SignedRetraction
|
||||||
:target_author_signature,
|
:target_author_signature,
|
||||||
:sender
|
:sender
|
||||||
|
|
||||||
|
def author
|
||||||
|
sender.person
|
||||||
|
end
|
||||||
|
|
||||||
def signable_accessors
|
def signable_accessors
|
||||||
accessors = self.class.roxml_attrs.collect do |definition|
|
accessors = self.class.roxml_attrs.collect do |definition|
|
||||||
definition.accessor
|
definition.accessor
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ if AppConfig.single_process_mode?
|
||||||
klass.send(:perform, *args)
|
klass.send(:perform, *args)
|
||||||
rescue Exception => e
|
rescue Exception => e
|
||||||
Rails.logger.warn(e.message)
|
Rails.logger.warn(e.message)
|
||||||
|
raise e
|
||||||
nil
|
nil
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,5 @@ module Diaspora
|
||||||
(self.send accessor.to_sym).to_s
|
(self.send accessor.to_sym).to_s
|
||||||
}.join(';')
|
}.join(';')
|
||||||
end
|
end
|
||||||
|
|
||||||
# @abstract
|
|
||||||
# @return [String]
|
|
||||||
#def signable_string
|
|
||||||
# raise NotImplementedError.new("Implement this in your encryptable class")
|
|
||||||
#end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,9 @@ class Postzord::Dispatcher::Private
|
||||||
|
|
||||||
# @param services [Array<User>]
|
# @param services [Array<User>]
|
||||||
def notify_users(users)
|
def notify_users(users)
|
||||||
Resque.enqueue(Job::NotifyLocalUsers, users.map{|u| u.id}, @object.class.to_s, @object.id, @object.author.id)
|
if @object.respond_to?(:persisted?)
|
||||||
|
Resque.enqueue(Job::NotifyLocalUsers, users.map{|u| u.id}, @object.class.to_s, @object.id, @object.author.id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# @param services [Array<User>]
|
# @param services [Array<User>]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue