I have some questions about the MimeVisitor class.
I have an extension where I register my converter and my mutator class.
I want the mutator to take actions when I send a message only and not when a new message comes.
The same with a converter. I want my converter's functions to be invoked only when I read a message and not when a new message is added to a mailbox.
My question is how can I check in my function if a message is being send or received ? And what can I do to not invoke a conversion while the new message is comming? Is it possible at all ?
Here is an example of a converter
Code:
@Override
protected boolean visitMessage(MimeMessage mm, VisitPhase visitKind) throws MessagingException {
if (visitKind != VisitPhase.VISIT_BEGIN) {
return false;
}
if (.....) { // here i want to check if it's an old message to start my conversion
if (mCallback != null && mCallback.onModification() == false) {
return false;
}
// do some modifications on the message .....
mm.saveChanges();
return true;
}
return false;
}
Can I access some info about user account (account ID ...) in that function?