]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Msn/MsnPlugin.php
Using GNUSOCIAL_VERSION instead of STATUSNET_VERSION
[quix0rs-gnu-social.git] / plugins / Msn / MsnPlugin.php
index 187486eedcb687aa4e75a429ef09446a8864d9a1..11bade80342e9a67be78a06cee4810627fcb325d 100644 (file)
@@ -46,7 +46,6 @@ set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . '/ext
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0\r
  * @link      http://status.net/\r
  */\r
-\r
 class MsnPlugin extends ImPlugin {\r
     public $user = null;\r
     public $password = null;\r
@@ -59,6 +58,7 @@ class MsnPlugin extends ImPlugin {
      * @return string Name of service\r
      */\r
     public function getDisplayName() {\r
+        // TRANS: Display name of the MSN instant messaging service.\r
         return _m('MSN');\r
     }\r
 \r
@@ -105,13 +105,9 @@ class MsnPlugin extends ImPlugin {
             case 'MSN':\r
                 require_once(INSTALLDIR.'/plugins/Msn/extlib/phpmsnclass/msn.class.php');\r
                 return false;\r
-            case 'MsnManager':\r
-            case 'Msn_waiting_message':\r
-                include_once $dir . '/'.strtolower($cls).'.php';\r
-                return false;\r
-            default:\r
-                return true;\r
         }\r
+\r
+        return parent::onAutoload($cls);\r
     }\r
 \r
     /*\r
@@ -120,7 +116,7 @@ class MsnPlugin extends ImPlugin {
      * @return boolean\r
      */\r
     public function onStartImDaemonIoManagers(&$classes) {\r
-        parent::onStartImDaemonIoManagers(&$classes);\r
+        parent::onStartImDaemonIoManagers($classes);\r
         $classes[] = new MsnManager($this); // handles sending/receiving\r
         return true;\r
     }\r
@@ -133,14 +129,7 @@ class MsnPlugin extends ImPlugin {
         $schema = Schema::get();\r
 \r
         // For storing messages while sessions become ready\r
-        $schema->ensureTable('msn_waiting_message',\r
-                             array(new ColumnDef('id', 'integer', null,\r
-                                                 false, 'PRI', null, null, true),\r
-                                   new ColumnDef('screenname', 'varchar', 255, false),\r
-                                   new ColumnDef('message', 'text', null, false),\r
-                                   new ColumnDef('created', 'datetime', null, false),\r
-                                   new ColumnDef('claimed', 'datetime')));\r
-\r
+        $schema->ensureTable('msn_waiting_message', Msn_waiting_message::schemaGet());\r
         return true;\r
     }\r
 \r
@@ -184,13 +173,16 @@ class MsnPlugin extends ImPlugin {
     */\r
     public function initialize() {\r
         if (!isset($this->user)) {\r
-            throw new Exception("Must specify a user");\r
+            // TRANS: Exception thrown when configuration for the MSN plugin is incomplete.\r
+            throw new Exception(_m('Must specify a user.'));\r
         }\r
         if (!isset($this->password)) {\r
-            throw new Exception("Must specify a password");\r
+            // TRANS: Exception thrown when configuration for the MSN plugin is incomplete.\r
+            throw new Exception(_m('Must specify a password.'));\r
         }\r
         if (!isset($this->nickname)) {\r
-            throw new Exception("Must specify a nickname");\r
+            // TRANS: Exception thrown when configuration for the MSN plugin is incomplete.\r
+            throw new Exception(_m('Must specify a nickname.'));\r
         }\r
 \r
         return true;\r
@@ -205,10 +197,11 @@ class MsnPlugin extends ImPlugin {
     public function onPluginVersion(&$versions) {\r
         $versions[] = array(\r
             'name' => 'MSN',\r
-            'version' => STATUSNET_VERSION,\r
+            'version' => GNUSOCIAL_VERSION,\r
             'author' => 'Luke Fitzgerald',\r
             'homepage' => 'http://status.net/wiki/Plugin:MSN',\r
             'rawdescription' =>\r
+            // TRANS: Plugin description.\r
             _m('The MSN plugin allows users to send and receive notices over the MSN network.')\r
         );\r
         return true;\r