[csmaild-cvs] csmaild/src/Imap/Commands CopyCommand.cs,1.5,1.6 ImapCommand.cs,1.11,1.12 StatusComman
Brought to you by:
tamc
From: <ta...@us...> - 2003-08-03 01:08:40
|
Update of /cvsroot/csmaild/csmaild/src/Imap/Commands In directory sc8-pr-cvs1:/tmp/cvs-serv17718/src/Imap/Commands Modified Files: CopyCommand.cs ImapCommand.cs StatusCommand.cs Log Message: Support for UID commands Working COPY command Index: CopyCommand.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/CopyCommand.cs,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** CopyCommand.cs 29 Jul 2003 00:46:28 -0000 1.5 --- CopyCommand.cs 3 Aug 2003 01:08:38 -0000 1.6 *************** *** 1,2 **** --- 1,4 ---- + using Common; + using System; *************** *** 8,12 **** public class CopyCommand : ImapCommand { ! public CopyCommand(ImapServer svr) : base(svr, "COPY", ImapConnectionState.Selected) { } --- 10,14 ---- public class CopyCommand : ImapCommand { ! public CopyCommand(ImapServer svr) : base(svr, "COPY", ImapConnectionState.Selected, ArgumentType.SequenceSet, ArgumentType.AString) { } *************** *** 14,18 **** override protected void InternalProcess() { ! //return false; } } --- 16,50 ---- override protected void InternalProcess() { ! SequenceSet msgSet = mParsedArguments[0] as SequenceSet; ! string boxFullName = mParsedArguments[1] as string; ! ! Mailbox destination = mConnection.User.Mailboxes.FindMailbox(boxFullName); ! Mailbox source = mConnection.Mailbox; ! if(destination == null) ! mConnection.SendTaggedMessage("NO Destination does not exist"); ! else ! { ! SequenceSet.SequenceRange rng = msgSet.FirstRange; ! while(rng != null) ! { ! for(uint idx = rng.Low; idx <= rng.High; ++idx) ! { ! if(idx > source.MessageCount) ! break; ! ! Message msg = null; ! if(mUidCalled) ! msg = source.Messages.ByUID(idx); ! else ! msg = source.Messages.BySeq(idx); ! ! if(msg != null) ! destination.Messages.AddCopy(msg); ! } ! rng = rng.NextRange; ! } ! ! mConnection.SendTaggedMessage("OK Copy completed"); ! } } } Index: ImapCommand.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/ImapCommand.cs,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ImapCommand.cs 1 Aug 2003 22:02:37 -0000 1.11 --- ImapCommand.cs 3 Aug 2003 01:08:38 -0000 1.12 *************** *** 22,25 **** --- 22,26 ---- private ArgumentType[] mArgumentTypes; + protected bool mUidCalled; protected string mUnparsedArguments; protected int mUnparsedArgumentIdx; *************** *** 68,73 **** } ! public void Initialize(string arguments, ImapConnection con) { mUnparsedArguments = arguments; mConnection = con; --- 69,75 ---- } ! public void Initialize(string arguments, ImapConnection con, bool uidCalled) { + mUidCalled = uidCalled; mUnparsedArguments = arguments; mConnection = con; *************** *** 525,529 **** #region ParenthesizedList ! protected class ParenthesizedList { #region ParenthesizedListItem --- 527,531 ---- #region ParenthesizedList ! public class ParenthesizedList { #region ParenthesizedListItem Index: StatusCommand.cs =================================================================== RCS file: /cvsroot/csmaild/csmaild/src/Imap/Commands/StatusCommand.cs,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StatusCommand.cs 30 Jul 2003 22:45:50 -0000 1.6 --- StatusCommand.cs 3 Aug 2003 01:08:38 -0000 1.7 *************** *** 15,20 **** } - //status-att = "MESSAGES" / "RECENT" / "UIDNEXT" / "UIDVALIDITY" / "UNSEEN" - override protected void InternalProcess() { --- 15,18 ---- |