summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-01-16 13:40:49 -0800
committerBrion Vibber <brion@pobox.com>2010-01-16 13:40:49 -0800
commit9dc9c404cf5082ea769fb0c1d13c55742e046849 (patch)
treeb7b37627d97d49eea7b4157eb2ec91b278447dd9
parentaea83bbe152efd127338270561a1cc56c46df44d (diff)
parent775c63b654dacf733e7bef99cb9f6f07aa824854 (diff)
Merge branch 'master' into 0.9.x
-rw-r--r--classes/Notice.php24
-rw-r--r--plugins/MemcachePlugin.php4
2 files changed, 23 insertions, 5 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)
diff --git a/plugins/MemcachePlugin.php b/plugins/MemcachePlugin.php
index 5214ab9c8..8c8b8da6d 100644
--- a/plugins/MemcachePlugin.php
+++ b/plugins/MemcachePlugin.php
@@ -170,8 +170,8 @@ class MemcachePlugin extends Plugin
$servers = array($this->servers);
}
foreach ($servers as $server) {
- if (strpos($server, ':') !== false) {
- list($host, $port) = explode(':', $server);
+ if (strpos($server, ';') !== false) {
+ list($host, $port) = explode(';', $server);
} else {
$host = $server;
$port = 11211;