X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FGroupPrivateMessage%2FGroupPrivateMessagePlugin.php;h=0f5c1a88309a35d1f0f02bf8e6b9b5956750ea4b;hb=d6b28c64830f632bb2f4b6f3c9369b9e56ad217a;hp=036772d21d09a22ac377ceff9f1e01db6111e402;hpb=dc5b302fe9ac5906bac29b279dc78ad2d2625536;p=quix0rs-gnu-social.git diff --git a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php index 036772d21d..0f5c1a8830 100644 --- a/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php +++ b/plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php @@ -70,11 +70,11 @@ class GroupPrivateMessagePlugin extends Plugin /** * Map URLs to actions * - * @param Net_URL_Mapper $m path-to-action mapper + * @param URLMapper $m path-to-action mapper * * @return boolean hook value */ - function onRouterInitialized($m) + public function onRouterInitialized(URLMapper $m) { $m->connect('group/:nickname/inbox', array('action' => 'groupinbox'), @@ -187,12 +187,16 @@ class GroupPrivateMessagePlugin extends Plugin return true; } - function onEndGroupSaveForm(GroupAction $action) + function onEndGroupSaveForm(Action $action) { + // The Action class must contain this method + assert(is_callable(array($action, 'getGroup'))); + $gps = null; + $group = $action->getGroup(); - if (!empty($action->getGroup())) { - $gps = Group_privacy_settings::getKV('group_id', $action->getGroup()->id); + if ($group instanceof User_group) { + $gps = Group_privacy_settings::getKV('group_id', $group->id); } $orig = null; @@ -390,7 +394,7 @@ class GroupPrivateMessagePlugin extends Plugin return true; } - function onStartShowExportData(GroupAction $action) + function onStartShowExportData(Action $action) { if ($action instanceof ShowgroupAction) { $gps = Group_privacy_settings::forGroup($action->getGroup());