mention the name in the correct field, mark the professor as the chairperson and make they accept the rdv

This commit is contained in:
Mylloon 2024-01-30 20:21:21 +01:00
parent ae14925d9e
commit 52648ac61a
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

View file

@ -2,7 +2,7 @@ use std::sync::Arc;
use chrono::TimeZone; use chrono::TimeZone;
use ics::{ use ics::{
parameters::{Language, TzIDParam}, parameters::{Language, PartStat, Role, TzIDParam, CN},
properties::{ properties::{
Attendee, Categories, Class, Description, DtEnd, DtStart, Location, Summary, Transp, Attendee, Categories, Class, Description, DtEnd, DtStart, Location, Summary, Transp,
}, },
@ -40,9 +40,12 @@ pub fn export(courses: Vec<crate::timetable::models::Course>, filename: &mut Str
// Professor's name // Professor's name
if course.professor.is_some() { if course.professor.is_some() {
event.push(Attendee::new( let name = course.professor.unwrap();
"mailto:".to_owned() + &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 // Start time of the course