[Csmail-patches] CVS: csmail/src/CSMail ChangeLog,1.23,1.24 Folder.cs,1.3,1.4 InternetAddress.cs,1.4
Status: Pre-Alpha
Brought to you by:
mastergaurav
From: Gaurav V. <mas...@us...> - 2002-09-03 12:38:49
|
Update of /cvsroot/csmail/csmail/src/CSMail In directory usw-pr-cvs1:/tmp/cvs-serv25155 Modified Files: ChangeLog Folder.cs InternetAddress.cs Service.cs Session.cs URLName.cs Log Message: 2002-09-03 * Service.cs : Connect(...) - Implemented : Connect / Close - Marked "virtual" : GetHostAndProto(...) - Stubbed * MessagingException.cs : Added new class / exception. * URLName.cs : Host -> Hostname * Folder.cs : Corrections due to URLName * Session.cs : Added property "Properties" * InternetAddress.cs : Added new ctor (Needed in Service) Index: ChangeLog =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/ChangeLog,v retrieving revision 1.23 retrieving revision 1.24 diff -u -r1.23 -r1.24 --- ChangeLog 3 Sep 2002 04:17:00 -0000 1.23 +++ ChangeLog 3 Sep 2002 12:38:45 -0000 1.24 @@ -1,6 +1,18 @@ 2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Service.cs : Connect(...) - Implemented + : Connect / Close - Marked "virtual" + : GetHostAndProto(...) + - Stubbed + * MessagingException.cs : Added new class / exception. + * URLName.cs : Host -> Hostname + * Folder.cs : Corrections due to URLName + * Session.cs : Added property "Properties" + * InternetAddress.cs : Added new ctor (Needed in Service) + +2002-09-03 Gaurav Vaish <mastergaurav AT users DOT sf DOT net> + * Session.cs : Fixed GetStore(URLName) and GetTransport(URLName) bugs * Transport.cs : "using System" bug fixed Index: Folder.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Folder.cs,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- Folder.cs 28 Aug 2002 10:25:52 -0000 1.3 +++ Folder.cs 3 Sep 2002 12:38:45 -0000 1.4 @@ -120,7 +120,7 @@ URLName retVal = Store.URL; String fn = (FullName == null ? String.Empty : FullName); char c = Separator; - return new URLName(retVal.Protocol, retVal.Host, retVal.Port, + return new URLName(retVal.Protocol, retVal.Hostname, retVal.Port, retVal.Username, retVal.Password, null); } } Index: InternetAddress.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/InternetAddress.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- InternetAddress.cs 28 Aug 2002 10:17:12 -0000 1.4 +++ InternetAddress.cs 3 Sep 2002 12:38:45 -0000 1.5 @@ -36,6 +36,12 @@ } } + [MailTODO] + public InternetAddress(string fullURI) + { + throw new NotImplementedException(); + } + /// <summary> /// Currently only IP_V4 formats are supported. To support /// the IP_V6 format IPs, I have to first go through the Index: Service.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Service.cs,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Service.cs 2 Sep 2002 12:49:17 -0000 1.4 +++ Service.cs 3 Sep 2002 12:38:45 -0000 1.5 @@ -59,25 +59,83 @@ } [MailTODO] - public void Close() + public virtual void Close() { throw new NotImplementedException(); } - [MailTODO] - public void Connect() + public virtual void Connect() { - throw new NotImplementedException(); + Connect(null, null, null); + } + + public virtual void Connect(InternetAddress hostname, string username, string password) + { + Connect(hostname, -1, username, password); } [MailTODO] - public void Connect(InternetAddress hostname, string username, string password) + public virtual void Connect(InternetAddress host, int port, string username, string password) { + if(Connected) + throw new MessagingException("[Connect] Already connected"); + string c_protocol = null; + string c_hostname; + string c_username = username; + string c_password = password; + string c_file; + InternetAddress c_host = host; + int c_port; + + if(url != null) + { + c_protocol = url.Protocol; + c_hostname = (host == null ? url.Hostname : host.Hostname); + c_port = (port == -1 ? url.Port : port); + if(c_username == null) + { + c_username = url.Username; + if(c_password == null) + c_password = url.Password; + } else if(c_password == null) + { + if(username == url.Username) + c_password = url.Password; + } + c_file = url.File; + } + if(c_protocol != null) + { + if(host == null) + { + string s_host; + GetHostAndProto((string)session.Properties["mail." + c_protocol + ".host"], + out s_host); + c_host = new InternetAddress(s_host, c_protocol); + c_hostname = s_host; + } + if(c_username == null) + { + c_username = (string)session.Properties["mail." + c_protocol + ".user"]; + } + } + if(c_host == null) + { + string s_host; + GetHostAndProto((string)session.Properties["mail.host"], + out s_host); + c_host = new InternetAddress(s_host, c_protocol); + c_hostname = s_host; + } + if(c_username == null) + { + c_username = (string)session.Properties["mail.user"]; + } throw new NotImplementedException(); } [MailTODO] - public void Connect(InternetAddress hostname, int port, string username, string password) + private void GetHostAndProto(string key, out string hostname) { throw new NotImplementedException(); } Index: Session.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/Session.cs,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- Session.cs 3 Sep 2002 04:17:00 -0000 1.13 +++ Session.cs 3 Sep 2002 12:38:45 -0000 1.14 @@ -43,6 +43,14 @@ } } + public Properties Properties + { + get + { + return properties; + } + } + public Store GetStore() { return GetStore("mail.store.protocol"); Index: URLName.cs =================================================================== RCS file: /cvsroot/csmail/csmail/src/CSMail/URLName.cs,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- URLName.cs 2 Sep 2002 11:04:27 -0000 1.2 +++ URLName.cs 3 Sep 2002 12:38:45 -0000 1.3 @@ -67,7 +67,7 @@ } } - public string Host + public string Hostname { get { @@ -128,7 +128,7 @@ public bool Equals(URLName url) { - if(url.Protocol == protocol && url.Host == host && url.Port == port && + if(url.Protocol == protocol && url.Hostname == host && url.Port == port && url.Username == username && url.Password == password) { return true; |