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/05/14 03:06:10 UTC

[GitHub] [james-project] Arsnael commented on a change in pull request #428: [REFACTORING] More reactive messageid manager

Arsnael commented on a change in pull request #428:
URL: https://github.com/apache/james-project/pull/428#discussion_r632243891



##########
File path: mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMessageIdManager.java
##########
@@ -456,45 +454,53 @@ public void setInMailboxesNoCheck(MessageId messageId, MailboxId targetMailboxId
         }
     }
 
-    private void addMessageToMailboxes(MailboxMessage mailboxMessage, Set<Mailbox> mailboxes, MailboxSession mailboxSession) throws MailboxException {
+    private Mono<Void> addMessageToMailboxes(MailboxMessage mailboxMessage, Set<Mailbox> mailboxes, MailboxSession mailboxSession) {
         MessageIdMapper messageIdMapper = mailboxSessionMapperFactory.getMessageIdMapper(mailboxSession);
 
-        for (Mailbox mailbox : mailboxes) {
-            MailboxACL.Rfc4314Rights myRights = rightManager.myRights(mailbox, mailboxSession);
-            boolean shouldPreserveFlags = myRights.contains(Right.Write);
-            SimpleMailboxMessage copy =
-                SimpleMailboxMessage.from(mailboxMessage)
-                    .mailboxId(mailbox.getMailboxId())
-                    .flags(
-                        FlagsFactory
-                            .builder()
-                            .flags(mailboxMessage.createFlags())
-                            .filteringFlags(
-                                FlagsFilter.builder()
-                                    .systemFlagFilter(f -> shouldPreserveFlags)
-                                    .userFlagFilter(f -> shouldPreserveFlags)
-                                    .build())
-                            .build())
-                    .build();
-            save(messageIdMapper, copy, mailbox);
-
-            eventBus.dispatch(EventFactory.added()
-                    .randomEventId()
-                    .mailboxSession(mailboxSession)
-                    .mailbox(mailbox)
-                    .addMetaData(copy.metaData())
-                    .build(),
-                    new MailboxIdRegistrationKey(mailbox.getMailboxId()))
-                .block();
-        }
+        System.out.println("Adding to " + mailboxes);

Review comment:
       Not resolved...




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

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