quantranhong1999 commented on a change in pull request #515:
URL: https://github.com/apache/james-project/pull/515#discussion_r660484180
##########
File path:
mailbox/store/src/main/java/org/apache/james/mailbox/store/MessageStorer.java
##########
@@ -72,22 +73,25 @@
private final MessageFactory messageFactory;
private final AttachmentMapperFactory attachmentMapperFactory;
private final MessageParser messageParser;
+ private final ThreadIdGuessingAlgorithm threadIdGuessingAlgorithm;
public WithAttachment(MailboxSessionMapperFactory mapperFactory,
MessageId.Factory messageIdFactory,
MessageFactory messageFactory,
AttachmentMapperFactory attachmentMapperFactory,
- MessageParser messageParser) {
+ MessageParser messageParser,
ThreadIdGuessingAlgorithm threadIdGuessingAlgorithm) {
this.mapperFactory = mapperFactory;
this.messageIdFactory = messageIdFactory;
this.messageFactory = messageFactory;
this.attachmentMapperFactory = attachmentMapperFactory;
this.messageParser = messageParser;
+ this.threadIdGuessingAlgorithm = threadIdGuessingAlgorithm;
}
@Override
public Mono<Pair<MessageMetaData,
Optional<List<MessageAttachmentMetadata>>>> appendMessageToStore(Mailbox
mailbox, Date internalDate, int size, int bodyStartOctet, Content content,
Flags flags, PropertyBuilder propertyBuilder, Optional<Message> maybeMessage,
MailboxSession session) throws MailboxException {
MessageMapper messageMapper =
mapperFactory.getMessageMapper(session);
MessageId messageId = messageIdFactory.generate();
- ThreadId threadId = ThreadId.fromBaseMessageId(messageId);
+ // TODO get mime message header fields
Review comment:
How about using this header instance to get headers fields needed for
ThreadIdGuessingAlgorithm, and still place ThreadIdGuessingAlgorithm at
MessageStorer::appendMessageToStore as I am doing now? Because I think threadId
should go with messageId. Otherwise we should move messageIdFactory.generate
out of MessageStorer::appendMessageToStore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]