Thomas Bruederli
2012-06-11 2950ce49eff42eb08cd4363975a3292692cbccd8
program/include/rcmail.php
@@ -1997,6 +1997,31 @@
    }
    /**
     * Returns real size (calculated) of the message part
     *
     * @param rcube_message_part  Message part
     *
     * @return string Part size (and unit)
     */
    public function message_part_size($part)
    {
        if (isset($part->d_parameters['size'])) {
            $size = $this->show_bytes((int)$part->d_parameters['size']);
        }
        else {
          $size = $part->size;
          if ($part->encoding == 'base64') {
            $size = $size / 1.33;
          }
          $size = '~' . $this->show_bytes($size);
        }
        return $size;
    }
    /************************************************************************
     *********          Deprecated methods (to be removed)          *********
     ***********************************************************************/