From 8449256817f5a2bd7a7cac6bc04e4cb477d7dc49 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 9 Feb 2010 18:32:52 -0800 Subject: OStatus partial support for group subscriptions: * detection of group feeds is currently a nasty hack based on presence of '/groups/' in URL -- should use some property on the feed? * listing for the remote group is kinda cruddy; needs to be named more cleanly * still need to establish per-author profiles (easier once we have the updated Atom code in) * group delivery probably not right yet * saving of group messages still triggering some weird behavior Added support for since_id and max_id on group timeline feeds as a free extra. Enjoy! --- plugins/OStatus/actions/feedsubsettings.php | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'plugins/OStatus/actions') diff --git a/plugins/OStatus/actions/feedsubsettings.php b/plugins/OStatus/actions/feedsubsettings.php index 4d5b7b60f..6f592bf5b 100644 --- a/plugins/OStatus/actions/feedsubsettings.php +++ b/plugins/OStatus/actions/feedsubsettings.php @@ -209,7 +209,7 @@ class FeedSubSettingsAction extends ConnectSettingsAction return; } } - + // And subscribe the current user to the local profile $user = common_current_user(); $profile = $this->feedinfo->getProfile(); @@ -217,12 +217,22 @@ class FeedSubSettingsAction extends ConnectSettingsAction throw new ServerException("Feed profile was not saved properly."); } - if ($user->isSubscribed($profile)) { - $this->showForm(_m('Already subscribed!')); - } elseif ($user->subscribeTo($profile)) { - $this->showForm(_m('Feed subscribed!')); + if ($this->feedinfo->isGroup()) { + if ($user->isMember($profile)) { + $this->showForm(_m('Already a member!')); + } elseif (Group_member::join($this->feedinfo->group_id, $user->id)) { + $this->showForm(_m('Joined remote group!')); + } else { + $this->showForm(_m('Remote group join failed!')); + } } else { - $this->showForm(_m('Feed subscription failed!')); + if ($user->isSubscribed($profile)) { + $this->showForm(_m('Already subscribed!')); + } elseif ($user->subscribeTo($profile)) { + $this->showForm(_m('Feed subscribed!')); + } else { + $this->showForm(_m('Feed subscription failed!')); + } } } } -- cgit v1.2.3-54-g00ecf