summaryrefslogtreecommitdiff
path: root/classes/User.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-03 19:00:02 +0000
committerBrion Vibber <brion@pobox.com>2010-03-03 19:00:02 +0000
commit3bb42d117027ebf610481ca3b0733854e0127e56 (patch)
treed0e5aa1f5fb0407879f4ba155dbfe170165a6dd6 /classes/User.php
parente6fd387c94f858a7cc63b90b02ad2afb135b6aba (diff)
Use poster's subscribed groups to disambiguate group linking when a remote group and a local group exist with the same name. (If you're a member of two groups with the same name though, there's not a defined winner.)
Diffstat (limited to 'classes/User.php')
-rw-r--r--classes/User.php24
1 files changed, 2 insertions, 22 deletions
diff --git a/classes/User.php b/classes/User.php
index 57d76731b..aa9fbf948 100644
--- a/classes/User.php
+++ b/classes/User.php
@@ -612,28 +612,8 @@ class User extends Memcached_DataObject
function getGroups($offset=0, $limit=null)
{
- $qry =
- 'SELECT user_group.* ' .
- 'FROM user_group JOIN group_member '.
- 'ON user_group.id = group_member.group_id ' .
- 'WHERE group_member.profile_id = %d ' .
- 'ORDER BY group_member.created DESC ';
-
- if ($offset>0 && !is_null($limit)) {
- if ($offset) {
- if (common_config('db','type') == 'pgsql') {
- $qry .= ' LIMIT ' . $limit . ' OFFSET ' . $offset;
- } else {
- $qry .= ' LIMIT ' . $offset . ', ' . $limit;
- }
- }
- }
-
- $groups = new User_group();
-
- $cnt = $groups->query(sprintf($qry, $this->id));
-
- return $groups;
+ $profile = $this->getProfile();
+ return $profile->getGroups($offset, $limit);
}
function getSubscriptions($offset=0, $limit=null)