To make it possible to display memoryhole correcly to the user,
MimeTreeParser needs to have the ability to update/change headers.
For this we need an interface to change the headers.
Details
- Reviewers
vkrause - Maniphest Tasks
- T8568: Create Interface to MimeTreeParser for Headers
- Commits
- R94:aaa7ca90765b: WIP: Interface for mail headers in MimeTreeParser
Diff Detail
- Repository
- R94 PIM: Message Library
- Branch
- dev
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 3223 Build 3241: arc lint + arc unit
@vkrause: Unfortunately I forgotten what we discussed at Akademy what a better interface would look like. That's why I started now to implement that one. I think we thought at something like a "HeaderObject":
const auto headerObject = nodeHelper->headerObject(message); headerObject->hasHeader("to"); headerObject->header("simple"); /return Base headerObject->asAddressList("to"); headerObject->date();
And what about the idea of a "HeaderObject" instead of methos inside nodehelper?
mimetreeparser/src/nodehelper.cpp | ||
---|---|---|
526 ↗ | (On Diff #42347) | Good point ;D I haven't thought about it - but yes we have to pass QSharedPointer around. |
529 ↗ | (On Diff #42347) | I don't understand the magic inside KMime not that deeply about all these headers and classes and subclasses. I just copied that part from messageviewer/src/header/headerstyle_util.cpp |
mimetreeparser/src/nodehelper.cpp | ||
---|---|---|
529 ↗ | (On Diff #42347) | Well, first of all most of those headers are already of type AddressList, so those should be usable directly. For the one exception (From IIRC) the question is whether we need to convert that or if the consumer could handle that as well. Alternatively it might be worth looking if whatever the consumer expects can be added to From's type in KMime directly. The KMime header class hierarchy pretty much follows the MIME RFCs one to one and uses the same names as defined in the standard. |
messageviewer/src/header/grantleeheaderformatter.cpp | ||
---|---|---|
305 ↗ | (On Diff #42347) | should be Resent-To :D |
mimetreeparser/src/nodehelper.cpp | ||
529 ↗ | (On Diff #42347) | we we could enable the shortcuts, but we have more headers that are expected as AddressList: Form. Resent-To, Resent-To, List-Id |
mimetreeparser/src/nodehelper.cpp | ||
---|---|---|
529 ↗ | (On Diff #42347) | Well, do we need the full header object or is this ultimately only used for getting the list of addresses in that header? If so, how about we just get that and pass it along instead of the header object itself? If necessary by adding extra getters to KMime. |
mimetreeparser/src/nodehelper.cpp | ||
---|---|---|
529 ↗ | (On Diff #42347) | Yes but it would make sense to have the name and email addresses already splitted... |