accept comments from strangers
This commit is contained in:
parent
c7974f8046
commit
f3c20bf3c0
2 changed files with 1 additions and 3 deletions
|
|
@ -58,8 +58,7 @@ class Comment
|
||||||
end
|
end
|
||||||
|
|
||||||
def signature_valid?
|
def signature_valid?
|
||||||
Rails.logger.warn "Received comment has no person" unless person
|
person ? verify_signature(creator_signature, person) : true
|
||||||
verify_signature(creator_signature, person)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,6 @@ class User
|
||||||
person.save
|
person.save
|
||||||
|
|
||||||
elsif object.is_a?(Comment)
|
elsif object.is_a?(Comment)
|
||||||
object.person.save
|
|
||||||
raise "In receive for #{self.real_name}, signature was not valid on: #{object.inspect}" unless object.post.person == self.person || object.verify_post_creator_signature
|
raise "In receive for #{self.real_name}, signature was not valid on: #{object.inspect}" unless object.post.person == self.person || object.verify_post_creator_signature
|
||||||
object.save
|
object.save
|
||||||
dispatch_comment object unless owns?(object)
|
dispatch_comment object unless owns?(object)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue