From 2965a981b7ec22866fbdf2d567d87e2d068d3617 Mon Sep 17 00:00:00 2001
From: Thomas Bruederli <thomas@roundcube.net>
Date: Fri, 31 Jul 2015 16:04:08 -0400
Subject: [PATCH] Allow to search and import missing PGP pubkeys from keyservers using Publickey.js
---
program/lib/Roundcube/rcube_message_header.php | 48 ++++++++++++++++++++++++++++++++++++++++++------
1 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/program/lib/Roundcube/rcube_message_header.php b/program/lib/Roundcube/rcube_message_header.php
index 445d0bd..de764f4 100644
--- a/program/lib/Roundcube/rcube_message_header.php
+++ b/program/lib/Roundcube/rcube_message_header.php
@@ -1,9 +1,7 @@
<?php
-/**
+/*
+-----------------------------------------------------------------------+
- | program/include/rcube_message_header.php |
- | |
| This file is part of the Roundcube Webmail client |
| Copyright (C) 2005-2012, The Roundcube Dev Team |
| Copyright (C) 2011-2012, Kolab Systems AG |
@@ -14,7 +12,6 @@
| |
| PURPOSE: |
| E-mail message headers representation |
- | |
+-----------------------------------------------------------------------+
| Author: Aleksander Machniak <alec@alec.pl> |
+-----------------------------------------------------------------------+
@@ -170,6 +167,13 @@
public $mdn_to;
/**
+ * IMAP folder this message is stored in
+ *
+ * @var string
+ */
+ public $folder;
+
+ /**
* Other message headers
*
* @var array
@@ -192,6 +196,8 @@
'reply-to' => 'replyto',
'cc' => 'cc',
'bcc' => 'bcc',
+ 'mbox' => 'folder',
+ 'folder' => 'folder',
'content-transfer-encoding' => 'encoding',
'in-reply-to' => 'in_reply_to',
'content-type' => 'ctype',
@@ -218,7 +224,20 @@
$value = $this->others[$name];
}
- return $decode ? rcube_mime::decode_header($value, $this->charset) : $value;
+ if ($decode) {
+ if (is_array($value)) {
+ foreach ($value as $key => $val) {
+ $val = rcube_mime::decode_header($val, $this->charset);
+ $value[$key] = rcube_charset::clean($val);
+ }
+ }
+ else {
+ $value = rcube_mime::decode_header($value, $this->charset);
+ $value = rcube_charset::clean($value);
+ }
+ }
+
+ return $value;
}
/**
@@ -235,13 +254,30 @@
$this->others[$name] = $value;
}
}
+
+
+ /**
+ * Factory method to instantiate headers from a data array
+ *
+ * @param array Hash array with header values
+ * @return object rcube_message_header instance filled with headers values
+ */
+ public static function from_array($arr)
+ {
+ $obj = new rcube_message_header;
+ foreach ($arr as $k => $v)
+ $obj->set($k, $v);
+
+ return $obj;
+ }
}
/**
* Class for sorting an array of rcube_message_header objects in a predetermined order.
*
- * @package Mail
+ * @package Framework
+ * @subpackage Storage
* @author Aleksander Machniak <alec@alec.pl>
*/
class rcube_message_header_sorter
--
Gitblit v1.9.1