summaryrefslogtreecommitdiff
path: root/program/steps/mail/func.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2010-03-11 22:44:43 +0000
committerthomascube <thomas@roundcube.net>2010-03-11 22:44:43 +0000
commitbc404ffd41c3411510a022ae5b0c9f2bfe8f5db1 (patch)
treefb93534c5381332d04efe19e1d7f6f31b7558113 /program/steps/mail/func.inc
parent56505a11743d6869f6222f6b9467158edf295a44 (diff)
Save draft information in one header; finally fixes #1486203
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r--program/steps/mail/func.inc24
1 files changed, 24 insertions, 0 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 101a978cd..3f2ac0289 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1288,6 +1288,30 @@ function rcmail_wrap_quoted($text, $max = 76)
}
+function rcmail_draftinfo_encode($p)
+{
+ $parts = array();
+ foreach ($p as $key => $val)
+ $parts[] = $key . '=' . ($key == 'folder' ? base64_encode($val) : $val);
+
+ return join('; ', $parts);
+}
+
+
+function rcmail_draftinfo_decode($str)
+{
+ $info = array();
+ foreach (preg_split('/;\s+/', $str) as $part) {
+ list($key, $val) = explode('=', $part, 2);
+ if ($key == 'folder')
+ $val = base64_decode($val);
+ $info[$key] = $val;
+ }
+
+ return $info;
+}
+
+
function rcmail_message_part_controls()
{
global $MESSAGE;