Jonas Meurer wrote:
- Not complete and not working get_raw_body_content()
can you elaborate on that? in my tests get_raw_body_content() indeed worked as expected. it results the whole body content, without any charset or mime parsing modifications applied.
Let's see:
public function get_raw_body_content() { return $this->imap->get_message_part($this->uid, $mime_id, 'TEXT', NULL, $fp); }
Ok, maybe it's working, but you should call get_message_part in this way:
$this->imap->get_message_part($this->uid);
Now, for performance, maybe it's possible to use 3rd argument of this function? Also if we call it with only one argument, do we need this get_raw_body_content wrapper?
- You're fetching text message body twice for checking if inline
message/part is signed/encrypted. This is of course not good for performance, you should store fetched body in memory for further use (e.g. by extending get_part_content function). It will be used probably once again in plugin and again for message displaying.
you mean that get_part_content should store the body content in part->body in case it's obligated to do so?
Something like that. Or create rcube_message::cache array and store fetched part bodies by uid and mime_id in it. This will probably require checking for allowed memory size.
As someone said, do we need to deal with inline signed/encrypted messages? Maybe it would be simpler to start with only MIME messages handling?