From f17d6f4a542a61e8cc7c256a0be58e1b2a6e3c54 Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Sat, 6 Jul 2013 20:44:07 +0000 Subject: [PATCH] Refactored "Email" to just "Mail" (email is not what you say anymore) --- Console/Console.cs | 6 +++--- Logic/Swarm/Person.cs | 8 ++++---- Site5/Pages/v5/Init/Default.aspx.cs | 2 +- Utility/Communications/CommsTransmitterMail.cs | 4 ++-- Utility/Mail/MailTransmitter.cs | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Console/Console.cs b/Console/Console.cs index 96726aa4..4cb1d46d 100644 --- a/Console/Console.cs +++ b/Console/Console.cs @@ -368,7 +368,7 @@ namespace Swarmops writer.WriteLine("{0},{1} (#{2}),{3},{4} ({5} år),{6},{7},'{8}'", org.Name, membership.Person.Name, membership.Person.Identity, membership.Person.IsMale ? "Man" : "Kvinna", - membership.Person.Birthdate.ToString("yyyy-MM-dd"), age, age > 6 && age < 26? "Ja":"Nej", membership.Person.Email, membership.Person.Phone); + membership.Person.Birthdate.ToString("yyyy-MM-dd"), age, age > 6 && age < 26? "Ja":"Nej", membership.Person.Mail, membership.Person.Phone); } } } @@ -620,11 +620,11 @@ namespace Swarmops // THERE ARE ACTIVE MEMBERSHIPS - string baseComparison = people[0].Email.ToLower() + people[0].Street.ToLower() + people [0].Phone; + string baseComparison = people[0].Mail.ToLower() + people[0].Street.ToLower() + people [0].Phone; for (int index = 1; index < people.Count; index++) { - string comparison = people[index].Email.ToLower() + people[index].Street.ToLower() + people[index].Phone; + string comparison = people[index].Mail.ToLower() + people[index].Street.ToLower() + people[index].Phone; } diff --git a/Logic/Swarm/Person.cs b/Logic/Swarm/Person.cs index 5db1157e..c4fbd81a 100644 --- a/Logic/Swarm/Person.cs +++ b/Logic/Swarm/Person.cs @@ -181,7 +181,7 @@ namespace Swarmops.Logic.Swarm } - public new virtual string Email + public new virtual string Mail { get { return base.Email; } set { SwarmDb.GetDatabaseForWriting().SetPersonEmail(Identity, value); } @@ -1006,11 +1006,11 @@ namespace Swarmops.Logic.Swarm } } - protected string EmailMD5 + protected string MailMD5 { get { - string email = this.Email.Trim().ToLowerInvariant(); + string email = this.Mail.Trim().ToLowerInvariant(); string md5 = MD5.Hash(email); @@ -1020,7 +1020,7 @@ namespace Swarmops.Logic.Swarm public string GetAvatarLink (int pixelSize) { - return string.Format("http://www.gravatar.com/avatar/{0}.jpg?s={1}&d=mm", this.EmailMD5, pixelSize); + return string.Format("http://www.gravatar.com/avatar/{0}.jpg?s={1}&d=mm", this.MailMD5, pixelSize); } public string GetSecureAvatarLink (int pixelSize) diff --git a/Site5/Pages/v5/Init/Default.aspx.cs b/Site5/Pages/v5/Init/Default.aspx.cs index 8f302e07..7b1a5d3a 100644 --- a/Site5/Pages/v5/Init/Default.aspx.cs +++ b/Site5/Pages/v5/Init/Default.aspx.cs @@ -640,7 +640,7 @@ public partial class Pages_v5_Init_Default : System.Web.UI.Page personOne = Swarmops.Logic.Swarm.Person.FromIdentity(1); if (System.Diagnostics.Debugger.IsAttached) { - if (personOne.CityName != "Duckville" || personOne.Email != "noreply@example.com") + if (personOne.CityName != "Duckville" || personOne.Mail != "noreply@example.com") // these values are returned in debug environments when no person is found { personOneExists = true; diff --git a/Utility/Communications/CommsTransmitterMail.cs b/Utility/Communications/CommsTransmitterMail.cs index 2e938fa4..80c9617f 100644 --- a/Utility/Communications/CommsTransmitterMail.cs +++ b/Utility/Communications/CommsTransmitterMail.cs @@ -29,7 +29,7 @@ namespace Swarmops.Utility.Communications // This is a rather simple mail (no images or stuff like that) mail.From = new MailAddress(comm[CommRenderPart.SenderMail], comm[CommRenderPart.SenderMail], Encoding.UTF8); - mail.To.Add(new MailAddress(person.Email, person.Name)); + mail.To.Add(new MailAddress(person.Mail, person.Name)); mail.Subject = comm[CommRenderPart.Subject]; mail.Body = comm[CommRenderPart.Subject]; @@ -44,7 +44,7 @@ namespace Swarmops.Utility.Communications } catch (Exception e) { - throw new OutboundCommTransmitException("Cannot send mail to " + person.Email, e); + throw new OutboundCommTransmitException("Cannot send mail to " + person.Mail, e); } } diff --git a/Utility/Mail/MailTransmitter.cs b/Utility/Mail/MailTransmitter.cs index f54576ac..c555c474 100644 --- a/Utility/Mail/MailTransmitter.cs +++ b/Utility/Mail/MailTransmitter.cs @@ -89,13 +89,13 @@ namespace Swarmops.Utility.Mail } else { - if (!Formatting.ValidateEmailFormat(recipient.Email.Trim())) + if (!Formatting.ValidateEmailFormat(recipient.Mail.Trim())) { continue; } message = new MailMessage(new MailAddress(fromAddress, qpUTF8.EncodeMailHeaderString(fromName), Encoding.UTF8), - new MailAddress(recipient.Email, qpUTF8.EncodeMailHeaderString(recipient.Name), Encoding.UTF8)); + new MailAddress(recipient.Mail, qpUTF8.EncodeMailHeaderString(recipient.Name), Encoding.UTF8)); } if (message == null)