chibenwa commented on a change in pull request #515:
URL: https://github.com/apache/james-project/pull/515#discussion_r660437287



##########
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:
       I think you need a hint there...
   
   MaximalBodyDescriptor do held a list of fields CF this debugging session:
   
   ![Screenshot from 2021-06-29 
16-17-11](https://user-images.githubusercontent.com/6928740/123771846-95fe7300-d8f5-11eb-841a-b0fb0aa600ae.png)
   
   We can contribute a `MaximalBodyDescriptor::getFiled(String name)` method in 
mime4J ?
   
   Then we would likely be able to do threadId guessing easily in 
`StoreMessageManager::appendMessage` (the one with the big try catch...) Then 
we can pass the threadId as a parameter to other methods just like properties...




-- 
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]

Reply via email to