]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / GroupPrivateMessage / GroupPrivateMessagePlugin.php
index 036772d21d09a22ac377ceff9f1e01db6111e402..0f5c1a88309a35d1f0f02bf8e6b9b5956750ea4b 100644 (file)
@@ -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());