]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/mailbox.php
don't hide unsub button for remote users
[quix0rs-gnu-social.git] / lib / mailbox.php
index e8323dc289917c9fd3b07d5bb0ac021cf3fc260a..f1f6e98c195343d9d36a4becba131b701b30531a 100644 (file)
@@ -31,8 +31,6 @@ if (!defined('LACONICA')) {
     exit(1);
 }
 
-require_once INSTALLDIR.'/lib/personal.php';
-
 define('MESSAGES_PER_PAGE', 20);
 
 /**
@@ -47,11 +45,11 @@ define('MESSAGES_PER_PAGE', 20);
  * @see      OutboxAction
  */
 
-class MailboxAction extends PersonalAction
+class MailboxAction extends CurrentUserDesignAction
 {
     var $page = null;
 
-    function prepare($args) 
+    function prepare($args)
     {
         parent::prepare($args);
 
@@ -137,6 +135,9 @@ class MailboxAction extends PersonalAction
             $message->free();
             unset($message);
         }
+        else {
+            $this->element('p', 'guide', _('You have no private messages. You can send private message to engage other users in conversation. People can send you messages for your eyes only.'));
+        }
     }
 
     function getMessages()
@@ -183,8 +184,8 @@ class MailboxAction extends PersonalAction
                                        'class' => 'url'));
         $avatar = $profile->getAvatar(AVATAR_STREAM_SIZE);
         $this->element('img', array('src' => ($avatar) ?
-                                    common_avatar_display_url($avatar) :
-                                    common_default_avatar(AVATAR_STREAM_SIZE),
+                                    $avatar->displayUrl() :
+                                    Avatar::defaultImage(AVATAR_STREAM_SIZE),
                                     'class' => 'photo avatar',
                                     'width' => AVATAR_STREAM_SIZE,
                                     'height' => AVATAR_STREAM_SIZE,
@@ -262,12 +263,12 @@ class MailboxAction extends PersonalAction
      * Returns either the name (and link) of the API client that posted the notice,
      * or one of other other channels.
      *
-     * @param string $source the source of the message 
+     * @param string $source the source of the message
      *
      * @return void
      */
 
-    function showSource($source) 
+    function showSource($source)
     {
         $source_name = _($source);
         switch ($source) {
@@ -294,4 +295,17 @@ class MailboxAction extends PersonalAction
         return;
     }
 
+    /**
+     * Mailbox actions are read only
+     *
+     * @param array $args other arguments
+     *
+     * @return boolean
+     */
+
+    function isReadOnly($args)
+    {
+         return true;
+    }
+
 }