From f5ec7c27070dac4ac28ba860f4cc9a808b5f7c30 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Tue, 23 Feb 2010 16:13:24 -0500 Subject: [PATCH 1/2] some logging for OStatusPlugin::onStartFindMentions() --- plugins/OStatus/OStatusPlugin.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 3a9e77c2a6..934c858ac1 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -235,9 +235,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(); From 269d567d9440e3c943f67aad428efce9d112385c Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Wed, 24 Feb 2010 15:20:06 -0500 Subject: [PATCH 2/2] use Subscription::start() for remote subscribes --- plugins/OStatus/classes/Ostatus_profile.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 9f9efb96ee..e8ab065224 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 + Subscription::start($this->localProfile(), $user->getProfile()); - if ($sub->insert()) { - // @fixme use subs_notify() if refactored to take profiles? - mail_subscribe_notify_profile($user, $this->localProfile()); - return true; - } - return false; + return true; } /** @@ -1127,7 +1118,6 @@ class Ostatus_profile extends Memcached_DataObject } } - protected static function getActivityObjectNickname($object, $hints=array()) { if ($object->poco) {