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 2022/11/24 02:52:18 UTC

[GitHub] [james-project] vttranlina commented on a diff in pull request #1329: [WIP] JAMES-3754 - IMAP support List command extension RFC-5258

vttranlina commented on code in PR #1329:
URL: https://github.com/apache/james-project/pull/1329#discussion_r1031011780


##########
protocols/imap/src/main/java/org/apache/james/imap/processor/ListProcessor.java:
##########
@@ -140,9 +153,18 @@ private Mono<Void> respondMailboxList(String referenceName, String mailboxName,
 
         MailboxPath basePath = computeBasePath(session, finalReferencename, isRelative);
 
-        return getMailboxManager().search(mailboxQuery(basePath, mailboxName, mailboxSession), Minimal, mailboxSession)
-            .doOnNext(metaData -> processResult(responder, isRelative, metaData, getMailboxType(session, metaData.getPath())))
-            .then();
+        if (selectSubscribed) {
+            return Flux.from(Throwing.supplier(() -> subscriptionManager.subscriptionsReactive(mailboxSession)).get())
+                .collectList()
+                .flatMapMany(litSubscribed -> getMailboxManager().search(mailboxQuery(basePath, mailboxName, mailboxSession), Minimal, mailboxSession)
+                    .filter(metaData -> litSubscribed.contains(metaData.getPath()))
+                    .doOnNext(metaData -> processResult(responder, isRelative, metaData, getMailboxType(session, metaData.getPath()), true)))
+                .then();

Review Comment:
   > Are we supposed to also return subscribed items that do not correspond to an existing mailbox?
   
   Yes, then we have an attribute `NonExistent` in response



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