Navigation Menu

Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andyedinborough committed Jun 14, 2015
1 parent 8658f7a commit 069ff99
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions ImapClient.cs
Expand Up @@ -305,10 +305,6 @@ public virtual string[] Capability()
IdlePause();
string command = GetTag() + "CAPABILITY";
string response = SendCommandGetResponse(command);
if (response.StartsWith("* CAPABILITY "))
response = response.Substring(13);
_Capability = response.Trim().Split(' ');
GetResponse();
IdleResume();
return _Capability;
}
Expand Down Expand Up @@ -352,7 +348,7 @@ public virtual Mailbox Examine(string mailboxName)
string tag = GetTag();
string command = tag + "EXAMINE " + _utf7.Encode(mailboxName).QuoteString();
string response = SendCommandGetResponse(command, mailbox);

IdleResume();
return mailbox;
}
Expand All @@ -365,7 +361,7 @@ public virtual void Expunge()
string tag = GetTag();
string command = tag + "EXPUNGE";
string response = SendCommandGetResponse(command);

IdleResume();
}

Expand Down Expand Up @@ -661,12 +657,6 @@ internal override void OnLogin(string login, string password)
throw new NotSupportedException();
}

if (result.StartsWith("* CAPABILITY "))
{
_Capability = result.Substring(13).Trim().Split(' ');
result = GetResponse();
}

if (!result.StartsWith(tag + "OK"))
{
if (result.StartsWith("+ ") && result.EndsWith("=="))
Expand Down Expand Up @@ -840,7 +830,7 @@ protected override string SendCommandGetResponse(string command)
return SendCommandGetResponse(command, _Mailbox);
}

protected virtual string SendCommandGetResponse(string command, Mailbox mailbox)
protected virtual string SendCommandGetResponse(string command, Mailbox mailbox)
{
var response = base.SendCommandGetResponse(command);
response = HandleUntaggedResponse(response, Mailbox);
Expand Down Expand Up @@ -868,6 +858,20 @@ protected virtual string HandleUntaggedResponse(string response, Mailbox mailbox

else if ((match = Regex.Match(response, @"UIDVALIDITY (\d+)")).Success)
mailbox.UIDValidity = match.Groups[1].Value.ToInt();


else if (response.StartsWith("* CAPABILITY "))
{
response = response.Substring(13);
_Capability = response.Trim().Split(' ');
}

else if (response.StartsWith("* OK"))
{

}

else return response;
}
response = GetResponse();
}
Expand Down

0 comments on commit 069ff99

Please sign in to comment.