From f8e2e6bf2dd2f1f3d421ae0067b7a5ee2ecc4bab Mon Sep 17 00:00:00 2001 From: Raphael Date: Mon, 16 Aug 2010 13:49:48 -0700 Subject: [PATCH] Infinite loops are the best --- app/models/person.rb | 6 +++++- app/models/user.rb | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/models/person.rb b/app/models/person.rb index 827d4945d..fd601076f 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -76,7 +76,7 @@ class Person end def send_comment( c ) - if self.owner.nil? + if self.remote? if c.post.person.owner.nil? #puts "The commenter is not here, and neither is the poster" elsif c.post.person.owner @@ -114,6 +114,10 @@ class Person def self.by_webfinger( identifier ) Person.first(:email => identifier.gsub('acct:', '')) end + + def remote? + owner.nil? + end protected def clean_url diff --git a/app/models/user.rb b/app/models/user.rb index e35ec88cb..fcd45a268 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -174,7 +174,7 @@ class User Rails.logger.debug("Saving object: #{object}") object.save object.socket_to_uid( id) if object.respond_to? :socket_to_uid - object.person.send_comment object if object.is_a? Comment + object.person.send_comment object if object.is_a? Comment && owns? object end end