summaryrefslogtreecommitdiff
path: root/plugins/OStatus/actions
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-02-25 13:02:08 -0800
committerBrion Vibber <brion@pobox.com>2010-02-25 13:02:08 -0800
commitb5b5184c885e74d9532409a5962f851c4baf41c4 (patch)
treeaaf0aae0468ff15bd61ad8f4234020ae40e1bd19 /plugins/OStatus/actions
parent7e0872c7ca9827220ad9859abaeea268c9d4fee6 (diff)
OStatus: fix remote groups to work with new user_groups/local_groups split.
- fix <activity:subject> generation so we get the profile info (what's available so far) - use id instead of nickname for group join/leave forms so we can join/leave remote groups while the rest of the groups UI remains limited to local groups (plugins are responsible for making sure remote notifications and permission checks are done) - fix remote notification when joining group through OStatus's remote subscribe form
Diffstat (limited to 'plugins/OStatus/actions')
-rw-r--r--plugins/OStatus/actions/ostatussub.php14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/OStatus/actions/ostatussub.php b/plugins/OStatus/actions/ostatussub.php
index 12832cdcf..aae22f868 100644
--- a/plugins/OStatus/actions/ostatussub.php
+++ b/plugins/OStatus/actions/ostatussub.php
@@ -333,10 +333,18 @@ class OStatusSubAction extends Action
$group = $this->oprofile->localGroup();
if ($user->isMember($group)) {
$this->showForm(_m('Already a member!'));
- } elseif (Group_member::join($this->oprofile->group_id, $user->id)) {
- $this->successGroup();
+ return;
+ }
+ if (Event::handle('StartJoinGroup', array($group, $user))) {
+ $ok = Group_member::join($this->oprofile->group_id, $user->id);
+ if ($ok) {
+ Event::handle('EndJoinGroup', array($group, $user));
+ $this->successGroup();
+ } else {
+ $this->showForm(_m('Remote group join failed!'));
+ }
} else {
- $this->showForm(_m('Remote group join failed!'));
+ $this->showForm(_m('Remote group join aborted!'));
}
} else {
$local = $this->oprofile->localProfile();