mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-27 18:27:43 +00:00
Added some properties to vCard responses
This commit is contained in:
parent
b57bc2c89f
commit
c2a43d6552
1 changed files with 28 additions and 0 deletions
|
@ -193,9 +193,14 @@ import biweekly.ICalendar;
|
||||||
import biweekly.component.VEvent;
|
import biweekly.component.VEvent;
|
||||||
import biweekly.parameter.ParticipationStatus;
|
import biweekly.parameter.ParticipationStatus;
|
||||||
import biweekly.property.Attendee;
|
import biweekly.property.Attendee;
|
||||||
|
import biweekly.property.CalendarScale;
|
||||||
|
import biweekly.property.Created;
|
||||||
|
import biweekly.property.LastModified;
|
||||||
import biweekly.property.Method;
|
import biweekly.property.Method;
|
||||||
import biweekly.property.Organizer;
|
import biweekly.property.Organizer;
|
||||||
import biweekly.property.RawProperty;
|
import biweekly.property.RawProperty;
|
||||||
|
import biweekly.property.Status;
|
||||||
|
import biweekly.property.Transparency;
|
||||||
import biweekly.util.ICalDate;
|
import biweekly.util.ICalDate;
|
||||||
|
|
||||||
public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHolder> {
|
public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHolder> {
|
||||||
|
@ -3633,9 +3638,20 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
return intent;
|
return intent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Created created = event.getCreated();
|
||||||
|
LastModified modified = event.getLastModified();
|
||||||
|
Transparency transparancy = event.getTransparency();
|
||||||
|
|
||||||
// https://tools.ietf.org/html/rfc5546#section-4.2.2
|
// https://tools.ietf.org/html/rfc5546#section-4.2.2
|
||||||
VEvent ev = new VEvent();
|
VEvent ev = new VEvent();
|
||||||
|
|
||||||
|
if (created != null)
|
||||||
|
ev.setCreated(created);
|
||||||
|
if (modified != null)
|
||||||
|
ev.setLastModified(modified);
|
||||||
|
if (transparancy != null)
|
||||||
|
ev.setTransparency(transparancy);
|
||||||
|
|
||||||
ev.setOrganizer(event.getOrganizer());
|
ev.setOrganizer(event.getOrganizer());
|
||||||
|
|
||||||
ev.setUid(event.getUid());
|
ev.setUid(event.getUid());
|
||||||
|
@ -3701,17 +3717,29 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
Attendee attendee = new Attendee(name, email);
|
Attendee attendee = new Attendee(name, email);
|
||||||
|
|
||||||
if (action == R.id.btnCalendarAccept) {
|
if (action == R.id.btnCalendarAccept) {
|
||||||
|
ev.setStatus(Status.accepted());
|
||||||
attendee.setParticipationStatus(ParticipationStatus.ACCEPTED);
|
attendee.setParticipationStatus(ParticipationStatus.ACCEPTED);
|
||||||
} else if (action == R.id.btnCalendarDecline) {
|
} else if (action == R.id.btnCalendarDecline) {
|
||||||
|
ev.setStatus(Status.declined());
|
||||||
attendee.setParticipationStatus(ParticipationStatus.DECLINED);
|
attendee.setParticipationStatus(ParticipationStatus.DECLINED);
|
||||||
} else if (action == R.id.btnCalendarMaybe) {
|
} else if (action == R.id.btnCalendarMaybe) {
|
||||||
|
ev.setStatus(Status.tentative());
|
||||||
attendee.setParticipationStatus(ParticipationStatus.TENTATIVE);
|
attendee.setParticipationStatus(ParticipationStatus.TENTATIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
ev.addAttendee(attendee);
|
ev.addAttendee(attendee);
|
||||||
|
|
||||||
|
// Microsoft specific properties:
|
||||||
|
// X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
|
||||||
|
// X-MICROSOFT-CDO-IMPORTANCE:1
|
||||||
|
// X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
|
||||||
|
// X-MICROSOFT-DISALLOW-COUNTER:FALSE
|
||||||
|
// X-MS-OLK-AUTOSTARTCHECK:FALSE
|
||||||
|
// X-MS-OLK-CONFTYPE:0
|
||||||
|
|
||||||
// https://icalendar.org/validator.html
|
// https://icalendar.org/validator.html
|
||||||
ICalendar response = new ICalendar();
|
ICalendar response = new ICalendar();
|
||||||
|
response.setCalendarScale(CalendarScale.gregorian());
|
||||||
response.setMethod(Method.REPLY);
|
response.setMethod(Method.REPLY);
|
||||||
response.addEvent(ev);
|
response.addEvent(ev);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue