Added calendar meeting URLs

This commit is contained in:
M66B
2023-10-29 12:35:59 +01:00
parent 8c50e11869
commit b06dd3894a
2 changed files with 25 additions and 12 deletions

View File

@@ -55,6 +55,7 @@ import biweekly.parameter.ParticipationStatus;
import biweekly.property.Action;
import biweekly.property.Attendee;
import biweekly.property.ICalProperty;
import biweekly.property.RawProperty;
import biweekly.property.RecurrenceRule;
import biweekly.property.Trigger;
import biweekly.util.Duration;
@@ -106,6 +107,26 @@ public class CalendarHelper {
return tzid;
}
static Uri getOnlineMeetingUrl(Context context, VEvent event) {
try {
RawProperty prop = event.getExperimentalProperty("X-GOOGLE-CONFERENCE");
if (prop == null)
prop = event.getExperimentalProperty("X-MICROSOFT-ONLINEMEETINGEXTERNALLINK");
if (prop == null)
prop = event.getExperimentalProperty("X-MICROSOFT-SKYPETEAMSMEETINGURL");
if (prop == null)
return null;
String url = prop.getValue();
if (TextUtils.isEmpty(url))
return null;
Uri uri = Uri.parse(url);
return (uri.isHierarchical() ? uri : null);
} catch (Throwable ex) {
Log.e(ex);
return null;
}
}
static Long exists(Context context, String selectedAccount, String selectedName, String uid) {
ContentResolver resolver = context.getContentResolver();
try (Cursor cursor = resolver.query(CalendarContract.Events.CONTENT_URI,