Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix copying of Attendees Uri-typed properties #643

Merged
merged 2 commits into from
Nov 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Ical.Net.Tests/SerializationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ public void AttendeesSerialized()

var evt = AttendeeTest.VEventFactory();
cal.Events.Add(evt);
// new Uri() creates lowercase for the "MAILTO:" part
// according to the RFC 2368 specification
// The casing of `MAILTO` is not in line with RFC 2368, but we should
// be able to deal with it nevertheless and preserve it the way it is.
const string org = "MAILTO:[email protected]";
evt.Organizer = new Organizer(org);

Expand All @@ -331,7 +331,7 @@ public void AttendeesSerialized()

foreach (var a in evt.Attendees)
{
var vals = GetValues(vEvt, "ATTENDEE", a.Value.ToString());
var vals = GetValues(vEvt, "ATTENDEE", a.Value.OriginalString.ToString());
foreach (var v in new Dictionary<string, string>
{
["CN"] = a.CommonName,
Expand Down
6 changes: 3 additions & 3 deletions Ical.Net/DataTypes/Attendee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ public override void CopyFrom(ICopyable obj)
if (obj is not Attendee atn) return;
base.CopyFrom(obj);

Value = new Uri(atn.Value.ToString());
Value = atn.Value;

// String assignments create new instances
CommonName = atn.CommonName;
Expand All @@ -263,8 +263,8 @@ public override void CopyFrom(ICopyable obj)

Rsvp = atn.Rsvp;

SentBy = atn.SentBy != null ? new Uri(atn.SentBy.ToString()) : null;
DirectoryEntry = atn.DirectoryEntry != null ? new Uri(atn.DirectoryEntry.ToString()) : null;
SentBy = atn.SentBy;
DirectoryEntry = atn.DirectoryEntry;
}

protected bool Equals(Attendee other) => Equals(SentBy, other.SentBy)
Expand Down
Loading