Conversation
core/src/main/java/com/yahoo/imapnio/async/data/ExtensionMailboxInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/request/ExamineFolderCommand.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/request/ImapArgumentFormatter.java
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/request/OpenFolderActionCommand.java
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/request/ImapArgumentFormatter.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/data/ExtendedModifiedSinceTerm.java
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/data/ExtensionMailboxInfo.java
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/response/ImapResponseMapper.java
Outdated
Show resolved
Hide resolved
3989ee1 to
962b00e
Compare
nituyahoo
left a comment
There was a problem hiding this comment.
some comments, not fully reviewed let us discuss first
core/src/main/java/com/yahoo/imapnio/async/data/ExtensionMailboxInfo.java
Outdated
Show resolved
Hide resolved
core/src/main/java/com/yahoo/imapnio/async/data/ExtensionMailboxInfo.java
Outdated
Show resolved
Hide resolved
| if (handled) { | ||
| resps[i] = null; | ||
| } else { | ||
| ir.reset(); // default back the parsing index |
There was a problem hiding this comment.
what happens if nomodseq and mailboxid is specified multiple times?
There was a problem hiding this comment.
We won't, based on RFC, we should always have one NoModSeq to indicate whether we support CondStore or not. Also, you can only have one MailBox Id for each folder. You can confirm with Ray about this.
| * @return the array of MessageNumberSet | ||
| * @throws ImapAsyncClientException will not throw | ||
| */ | ||
| public static MessageNumberSet[] buildMessageNumberSets(@Nullable final String msgNumbers) throws ImapAsyncClientException { |
There was a problem hiding this comment.
isn't this parsing available in the imap client by sun?
There was a problem hiding this comment.
No, that is the reason why Ray created MessageNumberSet.java.
| int i = 0; // msgset index | ||
| try { | ||
| for (final String element : msgSetStrs) { | ||
| if (element.contains(":")) { |
There was a problem hiding this comment.
No, extra space is not allowed. I add test cases for that.
| s.append(RECENT); | ||
| } else if (sf[0] == Flags.Flag.SEEN) { | ||
| s.append(SEEN); | ||
| } |
There was a problem hiding this comment.
what if sf[0] does not match any of the above?
please discuss
There was a problem hiding this comment.
Based on RFC, we currently only support above system flags; otherwise, it will count as user flag.
| } | ||
| } else { // user flag == 1 | ||
| s.append(uf[0]); | ||
| } |
There was a problem hiding this comment.
what if sf and uf is not specified?
There was a problem hiding this comment.
Based on getUserFlags(), it will try to find it in the HashMap. If it doesn't create the flag, it will add the flag into user flag. Since there is only one flag and the flag can only be user flag or system flag. As long as it is not system flag, it will count as user flag. You can check buildFlagString() created by Ray inside the same file to confirm the implementation flow.
| * @param items the data items | ||
| * @param changedSince changed since the given modification sequence | ||
| */ | ||
| public UidFetchCommand(@Nonnull final MessageNumberSet[] msgsets, @Nonnull final String items, @Nonnull final Long changedSince) { |
There was a problem hiding this comment.
why does uid fetch need message number set
There was a problem hiding this comment.
Based on rfc, we need a way to store message numbers or uids, so we use MessageNumberSet to store them and send it via uid fetch command.
| * @param action whether to replace, add or remove the flags | ||
| * @param unchangedSince unchanged since the given modification sequence | ||
| */ | ||
| public UidStoreFlagsCommand(@Nonnull final MessageNumberSet[] msgsets, @Nonnull final Flags flags, @Nonnull final FlagsAction action, |
There was a problem hiding this comment.
why does uid store require msg set
There was a problem hiding this comment.
Based on rfc, we need a way to store message numbers or uids, so we use MessageNumberSet to store them and send it via uid store command.
| * @throws ImapAsyncClientException when target class to covert to is not supported | ||
| */ | ||
| @Nonnull | ||
| public <T> T readValue(@Nonnull final IMAPResponse[] content, @Nonnull final Class<T> valueType, @Nonnull final FetchItem[] extensionItems) |
There was a problem hiding this comment.
Currently, only fetch command can have extension items. Therefore, only fetch result can have extension items as well.
1fdecff to
92c6795
Compare
d895c13 to
e3f6740
Compare
More test cases for MessageNumberSet null out mailboxinfo, try catch outside for string message number set, stringbuilder for formatter, constant mapper with parsing exception, fix version and developer name Update UT for exception, follow mailbox pattern Fix exception throw java docs for UT Fix javadoc check style for UT Address Fan's comment Undo style fix Update checkstyle_suppressions.xml Update version Remove reduant null and add test cases for null Update FailureType typo Update version Add new test cases for parsing bad string to cover branch. Remove constant length for condstore string Remove constant string length for unchange since Update version
| public final class ExtendedModifiedSinceTerm extends SearchTerm { | ||
|
|
||
| /** The name of the metadata item. */ | ||
| private final Flags entryName; |
There was a problem hiding this comment.
Do we know any servers that support modified since for specific flags?
There was a problem hiding this comment.
I have tried the following example from RFC 4551 and it works for yahoo mail and gmail:
Example 15:
C: a SEARCH MODSEQ "/flags/\draft" all 620162338
There was a problem hiding this comment.
@YuanxinWang , Are you sure? Yahoo/Aol does not even support CONDSTORE. Supporting individual flag modseq would be quite hard even for Gmail. Let me know if you want to do a hangout and show me what you tried.
|
Hello. Are there any plans to merge this? |
Description
a. added the UNCHANGEDSINCE STORE modifier.
b. added the MODIFIED response code that is used with an OK response
to the STORE command. (It can also be used in a NO response.)
c. added the CHANGEDSINCE FETCH modifier.
d. added a new MODSEQ search criterion.
e. defined an additional CONDSTORE parameter to SELECT/EXAMINE
commands.
f. added VANISHED UID FETCH modifier
Motivation and Context
Store command can send additional UNCHANGEDSINCE parameter, Store response can be parsed with MODIFIED response code, , Fetch command can send additional CHANGEDSINCE and Vanished parameter, Search command can send with MODSEQ parameter, and Select/Examine command can send additional CONDSTORE parameter, when CONDSTORE is supported. To support client to send that parameter added new classes.
How Has This Been Tested?
Added unit tests to verify
Screenshots (if appropriate):
Types of changes
Checklist: