Skip to content

Commit

Permalink
Correct attendee ical formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hulloitskai committed Sep 24, 2023
1 parent dc367fa commit 64853f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def calendar
cal = Icalendar::Calendar.new
cal.append_custom_property("x_wr_calname", "opencal")
cal.add_timezone(
TZInfo::Timezone.get(user.time_zone).ical_timezone(Time.current),
TZInfo::Timezone.get(user.time_zone.name).ical_timezone(Time.current),
)
cal.source = calendar_user_url(
user,
Expand Down
6 changes: 5 additions & 1 deletion app/models/activity.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,11 @@ def save_to_icalendar_event(event)
event.description = description
event.location = location
reservations.find_each do |reservation|
event.append_attendee("mailto:" + reservation.email_with_name)
attendee = Icalendar::Values::CalAddress.new(
"mailto:#{reservation.email}",
cn: reservation.name,
)
event.append_attendee(attendee)
end
attachment = Icalendar::Values::Uri.new(
join_activity_url(self),
Expand Down

0 comments on commit 64853f4

Please sign in to comment.