Skip to content

Commit

Permalink
formatting cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
andyedinborough committed Sep 3, 2013
1 parent c248b08 commit 9568b8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ImapClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,20 +285,27 @@ public virtual Mailbox Examine(string mailbox) {
x = new Mailbox(mailbox);
while (response.StartsWith("*")) {
Match m;

m = Regex.Match(response, @"(\d+) EXISTS");
if (m.Groups.Count > 1) { x.NumMsg = m.Groups[1].ToString().ToInt(); }
if (m.Groups.Count > 1)
x.NumMsg = m.Groups[1].ToString().ToInt();

m = Regex.Match(response, @"(\d+) RECENT");
if (m.Groups.Count > 1)
x.NumNewMsg = m.Groups[1].Value.ToInt();

m = Regex.Match(response, @"UNSEEN (\d+)");
if (m.Groups.Count > 1)
x.NumUnSeen = m.Groups[1].Value.ToInt();

m = Regex.Match(response, @"UIDVALIDITY (\d+)");
if (m.Groups.Count > 1)
x.UIDValidity = m.Groups[1].Value.ToInt();

m = Regex.Match(response, @" FLAGS \((.*?)\)");
if (m.Groups.Count > 1)
x.SetFlags(m.Groups[1].ToString());

response = GetResponse();
}
_SelectedMailbox = mailbox;
Expand Down
1 change: 1 addition & 0 deletions Tests/Clients.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public void Message_With_Attachments() {
public void Select_Folder() {
using (var imap = GetClient<ImapClient>()) {
imap.SelectMailbox("Notes");
imap.Examine("Notes").UIDValidity.ShouldBeGreaterThan(0);
imap.GetMessageCount().ShouldBeInRange(1, int.MaxValue);
}
}
Expand Down

0 comments on commit 9568b8b

Please sign in to comment.