We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 9dc9c404 authored by Brion Vibber's avatar Brion Vibber

Merge branch 'master' into 0.9.x

parents aea83bbe 775c63b6
...@@ -826,6 +826,10 @@ class Notice extends Memcached_DataObject ...@@ -826,6 +826,10 @@ class Notice extends Memcached_DataObject
return $ids; return $ids;
} }
/**
* @param $groups array of Group *objects*
* @param $recipients array of profile *ids*
*/
function whoGets($groups=null, $recipients=null) function whoGets($groups=null, $recipients=null)
{ {
$c = self::memcache(); $c = self::memcache();
...@@ -925,6 +929,9 @@ class Notice extends Memcached_DataObject ...@@ -925,6 +929,9 @@ class Notice extends Memcached_DataObject
return $ids; return $ids;
} }
/**
* @return array of Group objects
*/
function saveGroups() function saveGroups()
{ {
// Don't save groups for repeats // Don't save groups for repeats
...@@ -1117,11 +1124,22 @@ class Notice extends Memcached_DataObject ...@@ -1117,11 +1124,22 @@ class Notice extends Memcached_DataObject
return $ids; return $ids;
} }
/**
* Same calculation as saveGroups but without the saving
* @fixme merge the functions
* @return array of Group objects
*/
function getGroups() function getGroups()
{ {
// Don't save groups for repeats
if (!empty($this->repeat_of)) {
return array();
}
// XXX: cache me // XXX: cache me
$ids = array(); $groups = array();
$gi = new Group_inbox(); $gi = new Group_inbox();
...@@ -1132,13 +1150,13 @@ class Notice extends Memcached_DataObject ...@@ -1132,13 +1150,13 @@ class Notice extends Memcached_DataObject
if ($gi->find()) { if ($gi->find()) {
while ($gi->fetch()) { while ($gi->fetch()) {
$ids[] = $gi->group_id; $groups[] = clone($gi);
} }
} }
$gi->free(); $gi->free();
return $ids; return $groups;
} }
function asAtomEntry($namespace=false, $source=false) function asAtomEntry($namespace=false, $source=false)
......
...@@ -170,8 +170,8 @@ class MemcachePlugin extends Plugin ...@@ -170,8 +170,8 @@ class MemcachePlugin extends Plugin
$servers = array($this->servers); $servers = array($this->servers);
} }
foreach ($servers as $server) { foreach ($servers as $server) {
if (strpos($server, ':') !== false) { if (strpos($server, ';') !== false) {
list($host, $port) = explode(':', $server); list($host, $port) = explode(';', $server);
} else { } else {
$host = $server; $host = $server;
$port = 11211; $port = 11211;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment