diff options
-rw-r--r-- | plugins/OStatus/OStatusPlugin.php | 10 | ||||
-rw-r--r-- | plugins/OStatus/classes/Ostatus_profile.php | 16 |
2 files changed, 12 insertions, 14 deletions
diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 90abe034d..5feb53b26 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -221,9 +221,17 @@ class OStatusPlugin extends Plugin $webfinger = $wmatch[0]; + $this->log(LOG_INFO, "Checking Webfinger for address '$webfinger'"); + $oprofile = Ostatus_profile::ensureWebfinger($webfinger); - if (!empty($oprofile)) { + if (empty($oprofile)) { + + $this->log(LOG_INFO, "No Ostatus_profile found for address '$webfinger'"); + + } else { + + $this->log(LOG_INFO, "Ostatus_profile found for address '$webfinger'"); $profile = $oprofile->localProfile(); diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 61505206e..5e38a523e 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -299,18 +299,9 @@ class Ostatus_profile extends Memcached_DataObject throw new ServerException("Remote groups can't subscribe to local users"); } - // @fixme use regular channels for subbing, once they accept remote profiles - $sub = new Subscription(); - $sub->subscriber = $this->profile_id; - $sub->subscribed = $user->id; - $sub->created = common_sql_now(); // current time - - if ($sub->insert()) { - // @fixme use subs_notify() if refactored to take profiles? - mail_subscribe_notify_profile($user, $this->localProfile()); - return true; - } - return false; + Subscription::start($this->localProfile(), $user->getProfile()); + + return true; } /** @@ -1163,7 +1154,6 @@ class Ostatus_profile extends Memcached_DataObject } } - protected static function getActivityObjectNickname($object, $hints=array()) { if ($object->poco) { |