You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by GitBox <gi...@apache.org> on 2021/06/29 10:25:06 UTC

[GitHub] [james-project] quantranhong1999 commented on a change in pull request #515: JAMES-3516 Plug threadIdGuessingAlgorithm to MessageManager

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 messageId 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: notifications-unsubscribe@james.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org