From 52648ac61a81c9be6290067830a25f5bce9fd614 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Tue, 30 Jan 2024 20:21:21 +0100 Subject: [PATCH] mention the name in the correct field, mark the professor as the chairperson and make they accept the rdv --- src/ics.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/ics.rs b/src/ics.rs index b897589..2d1b129 100644 --- a/src/ics.rs +++ b/src/ics.rs @@ -2,7 +2,7 @@ use std::sync::Arc; use chrono::TimeZone; use ics::{ - parameters::{Language, TzIDParam}, + parameters::{Language, PartStat, Role, TzIDParam, CN}, properties::{ Attendee, Categories, Class, Description, DtEnd, DtStart, Location, Summary, Transp, }, @@ -40,9 +40,12 @@ pub fn export(courses: Vec, filename: &mut Str // Professor's name if course.professor.is_some() { - event.push(Attendee::new( - "mailto:".to_owned() + &course.professor.unwrap(), - )); + let name = course.professor.unwrap(); + let mut contact = Attendee::new(format!("mailto:{name}")); + contact.add(CN::new(name)); + contact.add(PartStat::ACCEPTED); + contact.add(Role::CHAIR); + event.push(contact); } // Start time of the course