]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
Merge branch 'fix-author-fallback' into 'nightly'
[quix0rs-gnu-social.git] / plugins / GroupPrivateMessage / GroupPrivateMessagePlugin.php
index 0788161dd30668e61e90aeceb9a8f4896ff9aede..bee504491f8a6e89a34cc17f3f95d923bcab5999 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,11 +187,14 @@ 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;
 
-        if (!empty($action->getGroup())) {
+        if ($action->getGroup() instanceof User_group) {
             $gps = Group_privacy_settings::getKV('group_id', $action->getGroup()->id);
         }
 
@@ -390,7 +393,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());
@@ -402,12 +405,12 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $versions[] = array('name' => 'GroupPrivateMessage',
                             'version' => GNUSOCIAL_VERSION,
                             'author' => 'Evan Prodromou',
-                            'homepage' => 'http://status.net/wiki/Plugin:GroupPrivateMessage',
+                            'homepage' => 'https://git.gnu.io/gnu/gnu-social/tree/master/plugins/GroupPrivateMessage',
                             'rawdescription' =>
                             // TRANS: Plugin description.
                             _m('Allow posting private messages to groups.'));