Update of /cvsroot/csmaild/csmaild/src/Imap/Commands
In directory sc8-pr-cvs1:/tmp/cvs-serv15527/src/Imap/Commands
Modified Files:
RenameCommand.cs SelectExamineCommand.cs
Log Message:
Modified to use new FindMailbox for a little bit cleaner code
Index: RenameCommand.cs
===================================================================
RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/RenameCommand.cs,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** RenameCommand.cs 29 Jul 2003 00:46:28 -0000 1.5
--- RenameCommand.cs 30 Jul 2003 22:36:42 -0000 1.6
***************
*** 19,24 ****
string dstName = mParsedArguments[1] as string;
! MailboxCollection srcBoxes = mConnection.User.Mailboxes.FindContainer(srcName, false);
! Mailbox srcBox = srcBoxes[Mailbox.ExtractName(srcName)];
if(srcBox == null)
mConnection.SendTaggedMessage("NO Source does not exist");
--- 19,23 ----
string dstName = mParsedArguments[1] as string;
! Mailbox srcBox = mConnection.User.Mailboxes.FindMailbox(srcName);
if(srcBox == null)
mConnection.SendTaggedMessage("NO Source does not exist");
Index: SelectExamineCommand.cs
===================================================================
RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/SelectExamineCommand.cs,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SelectExamineCommand.cs 29 Jul 2003 00:46:28 -0000 1.3
--- SelectExamineCommand.cs 30 Jul 2003 22:36:42 -0000 1.4
***************
*** 21,58 ****
string boxFullName = mParsedArguments[0] as string;
! MailboxCollection boxes = mConnection.User.Mailboxes.FindContainer(boxFullName, false);
! if(boxes == null)
mConnection.SendTaggedMessage("NO Does not exist");
else
{
! mConnection.Mailbox = boxes[Mailbox.ExtractName(boxFullName)];
! if(mConnection.Mailbox == null)
! {
! mConnection.State = ImapConnectionState.Authenticated;
! mConnection.SendTaggedMessage("NO Does not exist");
! }
! else
! {
! mConnection.State = ImapConnectionState.Selected;
! Mailbox box = mConnection.Mailbox;
! mConnection.SendUntaggedMessage("FLAGS (\\Seen \\Answered \\Flagged \\Deleted \\Draft \\Recent)");
! mConnection.SendUntaggedMessage(box.MessageCount.ToString() + " EXISTS");
! mConnection.SendUntaggedMessage(box.MessageRecentCount.ToString() + " RECENT");
! if(box.FirstUnseenMessageSeqNum != 0)
! mConnection.SendUntaggedMessage("OK [UNSEEN " + box.FirstUnseenMessageSeqNum + "]");
! if(mIsSelect)
! mConnection.SendUntaggedMessage("OK [PERMANENTFLAGS (\\Seen \\Answered \\Flagged \\Deleted \\Draft)]");
! else
! mConnection.SendUntaggedMessage("OK [PERMANENTFLAGS ()]");
! mConnection.SendUntaggedMessage("OK [UIDVALIDITY " + box.UniqueIdValidity.ToString() + "]");
! mConnection.SendUntaggedMessage("OK [UIDNEXT " + box.NextUniqueId + "]");
! mConnection.SendTaggedMessage(mIsSelect ? "OK [READ-WRITE]" : "OK [READ-ONLY]");
! }
}
}
--- 21,52 ----
string boxFullName = mParsedArguments[0] as string;
! mConnection.Mailbox = mConnection.User.Mailboxes.FindMailbox(boxFullName);
! if(mConnection.Mailbox == null)
! {
! mConnection.State = ImapConnectionState.Authenticated;
mConnection.SendTaggedMessage("NO Does not exist");
+ }
else
{
! mConnection.State = ImapConnectionState.Selected;
! Mailbox box = mConnection.Mailbox;
! mConnection.SendUntaggedMessage("FLAGS (\\Seen \\Answered \\Flagged \\Deleted \\Draft \\Recent)");
! mConnection.SendUntaggedMessage(box.MessageCount.ToString() + " EXISTS");
! mConnection.SendUntaggedMessage(box.MessageRecentCount.ToString() + " RECENT");
! if(box.FirstUnseenMessageSeqNum != 0)
! mConnection.SendUntaggedMessage("OK [UNSEEN " + box.FirstUnseenMessageSeqNum + "]");
! if(mIsSelect)
! mConnection.SendUntaggedMessage("OK [PERMANENTFLAGS (\\Seen \\Answered \\Flagged \\Deleted \\Draft)]");
! else
! mConnection.SendUntaggedMessage("OK [PERMANENTFLAGS ()]");
! mConnection.SendUntaggedMessage("OK [UIDVALIDITY " + box.UniqueIdValidity.ToString() + "]");
! mConnection.SendUntaggedMessage("OK [UIDNEXT " + box.NextUniqueId + "]");
! mConnection.SendTaggedMessage(mIsSelect ? "OK [READ-WRITE]" : "OK [READ-ONLY]");
}
}
|