summaryrefslogtreecommitdiff
path: root/program/include/rcmail.php
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-06-11 10:20:53 +0200
committerThomas Bruederli <thomas@roundcube.net>2012-06-11 10:20:53 +0200
commit2950ce49eff42eb08cd4363975a3292692cbccd8 (patch)
tree2ac6b3b9a4daa1a484281b8021ea5c66333b0e34 /program/include/rcmail.php
parentd447a4f2296e5e9afc9d79cede0e49b2d6210f9f (diff)
parent7ac99af37b3b761b4daf2f0d9340c17e7855c234 (diff)
Merge branch 'master' of github.com:roundcube/roundcubemail
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r--program/include/rcmail.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index a10a2aa72..8ec8cfe47 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1997,6 +1997,31 @@ class rcmail extends rcube
}
+ /**
+ * 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) *********
***********************************************************************/