-
Notifications
You must be signed in to change notification settings - Fork 624
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New message rendering methods on IMAP #155
New message rendering methods on IMAP #155
Conversation
includes IMAP. RFC 822 to come. * HTML rendering - MailCore#112 * Plain text - MailCore#111
For the asynchronous methods, what would the return type be? |
It would be void but and a callback would be provided. class IMAPMessageRenderingCallback { The asynchronous method has no return type (void) and will return immediately. |
Where would the callback class live? Is it OK to put it in MCIMAPAsyncSession or should it have it's own file? (I'm not sure of your conventions) |
I just though about cancellation. Maybe we should not be providing an Operation. That would make it less simple to use but would cover that case properly. |
What would the alternative be? |
I meant "we should be providing an operation". Hoa V. Dinh On Wednesday, June 26, 2013 at 10:15 PM, Paul Young wrote:
|
So |
IMAPMessageRenderingOperation. Create 4 methods but one operation class that change its behavior using flags. |
Nice. |
What should the targets for the new file be? (For the build settings) |
"static mailcore2 ios" and "static mailcore2 osx". |
Hopefully this is a start. I tried to understand how other operations work and what they're doing. A nudge in the right direction from here would be good. |
The start would be to implement the synchronous methods in IMAPSession. You have to create an object that implements HTMLRendererIMAPCallback and make the call to IMAPSession when in the callbacks. |
* Added rendering enumerated type. * Added result string. * Removed data. * Moved rendering methods from IMAP message rendering operation to IMAP session.
I don't follow exactly what you mean by this. I think you're saying make a call to this method, since it appears to already exist. |
Yes, you should make a call to htmlRendering(). It perform all the work for you. |
* Passing message ivar to methods in `main()`.
* Created a generic message renderer helper class. * Renamed "msg" to "message" in session rendering methods.
Would appreciate some guidance on this. I'm a little unclear on how to actually implement the callback methods. I'm guessing I'll need more than one of each in order to return just the body when necessary. |
You should just override the templateformainheader method to return an empty string. Hoa V. Dinh On Friday, June 28, 2013 at 9:30 PM, Paul Young wrote:
|
But I only want to return an empty string when only the body is requested. Not sure if you're suggesting having a separate (sub)class for rendering only the body, or using a single class and putting a conditional inside that method. |
From master (https://github.com/MailCore/mailcore2), by using those instructions, I got a conflict in the xcodeproj file:
|
Do you have local changes on master that haven't been pushed? |
I don't mean unstaged changes, I mean commits. Is your local branch ahead of the remote? |
I'm locally in sync with github. Hoà V. Dinh On Thursday, July 11, 2013 at 10:11 AM, Paul Young wrote:
|
Yeah, it was a fast-forward merge with no conflicts. |
I'm getting the following error when trying to implement in the examples.
How can I make sure that the class is available? |
Include it in MCOIMAP.h and in targets "static mailcore osx" and "static mailcore ios", add this file to "copy files" phase. |
I think this means I have too many calls "release" (I'm assuming
|
What's the crash stack trace? |
} | ||
else if (mRenderingType == IMAPMessageRenderingTypePlainTextBody) { | ||
mResult = session()->session()->plainTextBodyRendering(mMessage, folder(), &error); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mResult is not retained. It might be the cause.
This works end to end now. I'm happy to make any further changes/optimizations. I'd need to understand how testing works to add those. |
We can merge this first part for now. |
I'm going to sync with master before we merge. |
…-with-session Conflicts: build-mac/mailcore2.xcodeproj/project.pbxproj
Good to merge. 👍 |
Simple message rendering methods on IMAP.
How do we construct MCOIMAPMessage from the data we have saved? I might have only uid,subject, headers etc from the previous fetch of messages, I could not find a easy way to construct MCOIMAPMessage from that. |
For 0.3, I plan to make MCOIMAPMessage serializable.
|
I'm creating a pull request so it's easier to discuss and track changes as opposed to in the issues themselves.
As discussed in #112 and #111, this is a first pass at defining the interface. Currently only includes IMAP. RFC 822 to come.
I need to look further into the implementation and how the existing
IMAPMessage::htmlRendering
andHTMLRenderer::htmlForIMAPMessage
methods work. It's unclear to me at this point if these new methods need to take additional parameters for the callbacks or if callbacks will be created within their implementation.