]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/Aim/AimPlugin.php
Merge commit 'refs/merge-requests/157' of git://gitorious.org/statusnet/mainline...
[quix0rs-gnu-social.git] / plugins / Aim / AimPlugin.php
index 3855d1fb054e33c535e48245a36ca443c23802e2..e44505b21c7cb6b3a58a93a410cef506925b7243 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
  * @link      http://status.net/
  */
-
 class AimPlugin extends ImPlugin
 {
     public $user =  null;
@@ -57,6 +56,7 @@ class AimPlugin extends ImPlugin
 
     function getDisplayName()
     {
+        // TRANS: Display name.
         return _m('AIM');
     }
 
@@ -66,7 +66,7 @@ class AimPlugin extends ImPlugin
         return strtolower($screenname);
     }
 
-    function daemon_screenname()
+    function daemonScreenname()
     {
         return $this->user;
     }
@@ -116,32 +116,41 @@ class AimPlugin extends ImPlugin
 
     function microiduri($screenname)
     {
-        return 'aim:' . $screenname;    
+        return 'aim:' . $screenname;
     }
 
-    function send_message($screenname, $body)
+    function sendMessage($screenname, $body)
     {
         $this->fake_aim->sendIm($screenname, $body);
-           $this->enqueue_outgoing_raw($this->fake_aim->would_be_sent);
+           $this->enqueueOutgoingRaw($this->fake_aim->would_be_sent);
         return true;
     }
 
-    function receive_raw_message($message)
+    /**
+     * Accept a queued input message.
+     *
+     * @return true if processing completed, false if message should be reprocessed
+     */
+    function receiveRawMessage($message)
     {
         $info=Aim::getMessageInfo($message);
         $from = $info['from'];
-        $user = $this->get_user($from);
+        $user = $this->getUser($from);
         $notice_text = $info['message'];
 
-        return $this->handle_incoming($from, $notice_text);
+        $this->handleIncoming($from, $notice_text);
+
+        return true;
     }
 
     function initialize(){
         if(!isset($this->user)){
-            throw new Exception("must specify a user");
+            // TRANS: Exception thrown in AIM plugin when user has not been specified.
+            throw new Exception(_m('Must specify a user.'));
         }
         if(!isset($this->password)){
-            throw new Exception("must specify a password");
+            // TRANS: Exception thrown in AIM plugin when password has not been specified.
+            throw new Exception(_m('Must specify a password.'));
         }
 
         $this->fake_aim = new Fake_Aim($this->user,$this->password,4);
@@ -155,8 +164,8 @@ class AimPlugin extends ImPlugin
                             'author' => 'Craig Andrews',
                             'homepage' => 'http://status.net/wiki/Plugin:AIM',
                             'rawdescription' =>
+                            // TRANS: Plugin description.
                             _m('The AIM plugin allows users to send and receive notices over the AIM network.'));
         return true;
     }
 }
-