diff options
author | Evan Prodromou <evan@status.net> | 2010-01-19 00:31:42 -0500 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2010-01-19 00:31:42 -0500 |
commit | 01dc77c2fd783f8b7ff796ca06013804971c8f5e (patch) | |
tree | 4874bddd23ac870d8ea9bfff5c4d0479ef67bbad /classes | |
parent | 1f6bbc189012cb3a1d61be92bbc1d4ec6156afac (diff) | |
parent | c7f14cd7774d21e16aa6b020da71f318c648e3f0 (diff) |
Merge branch 'master' into 0.9.x
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Notice.php | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index a43ce867b..38b10db04 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -826,6 +826,10 @@ class Notice extends Memcached_DataObject return $ids; } + /** + * @param $groups array of Group *objects* + * @param $recipients array of profile *ids* + */ function whoGets($groups=null, $recipients=null) { $c = self::memcache(); @@ -925,6 +929,9 @@ class Notice extends Memcached_DataObject return $ids; } + /** + * @return array of Group objects + */ function saveGroups() { // Don't save groups for repeats @@ -1117,11 +1124,22 @@ class Notice extends Memcached_DataObject return $ids; } + /** + * Same calculation as saveGroups but without the saving + * @fixme merge the functions + * @return array of Group objects + */ function getGroups() { + // Don't save groups for repeats + + if (!empty($this->repeat_of)) { + return array(); + } + // XXX: cache me - $ids = array(); + $groups = array(); $gi = new Group_inbox(); @@ -1132,13 +1150,13 @@ class Notice extends Memcached_DataObject if ($gi->find()) { while ($gi->fetch()) { - $ids[] = $gi->group_id; + $groups[] = clone($gi); } } $gi->free(); - return $ids; + return $groups; } function asAtomEntry($namespace=false, $source=false) |