From 7e55fc00447923b40b2ffc87329fd95347d776f5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Fri, 6 Aug 2010 10:56:18 -0700 Subject: OStatus/FeedSub: tweaked PuSH feed garbage collection so other plugins can declare usage of a low-level feed or an OStatus profile besides profile subscriptions & group memberships. SubMirror: redid add-mirror frontend to accept a feed URL, then pass that on to OStatus, instead of pulling from your subscriptions. Profile: tweaked subscriberCount() so it doesn't subtract 1 for foreign profiles who aren't subscribed to themselves; instead excludes the self-subscription in the count query. Memcached_DataObject: tweak to avoid extra error spew in the DB error raising Work in progress: tweaking feedsub garbage collection so we can count other uses --- classes/Memcached_DataObject.php | 2 +- classes/Profile.php | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'classes') diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 7768fe757..0f1ed0489 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -574,7 +574,7 @@ class Memcached_DataObject extends Safe_DataObject function raiseError($message, $type = null, $behaviour = null) { $id = get_class($this); - if ($this->id) { + if (!empty($this->id)) { $id .= ':' . $this->id; } if ($message instanceof PEAR_Error) { diff --git a/classes/Profile.php b/classes/Profile.php index 0d0463b73..d7617f0b7 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -464,11 +464,9 @@ class Profile extends Memcached_DataObject $sub = new Subscription(); $sub->subscribed = $this->id; - + $sub->whereAdd('subscriber != subscribed'); $cnt = (int) $sub->count('distinct subscriber'); - $cnt = ($cnt > 0) ? $cnt - 1 : $cnt; - if (!empty($c)) { $c->set(common_cache_key('profile:subscriber_count:'.$this->id), $cnt); } -- cgit v1.2.3-54-g00ecf