Insert confirmed calendar events

pull/212/head
M66B 2 years ago
parent 3705f5061a
commit ef061a965f

@ -3712,7 +3712,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Bundle args = new Bundle();
args.putLong("message", message.id);
args.putLong("account", message.account);
args.putInt("status", CalendarContract.Events.STATUS_TENTATIVE);
new SimpleTask<String>() {
@Override

@ -238,6 +238,7 @@ import javax.mail.internet.MimeMessage;
import biweekly.Biweekly;
import biweekly.ICalendar;
import biweekly.component.VEvent;
import biweekly.property.Status;
import me.everything.android.ui.overscroll.IOverScrollDecor;
import me.everything.android.ui.overscroll.IOverScrollState;
import me.everything.android.ui.overscroll.IOverScrollStateListener;
@ -9735,7 +9736,6 @@ public class FragmentMessages extends FragmentBase
@Override
protected Long onExecute(Context context, Bundle args) throws Throwable {
long id = args.getLong("message");
int status = args.getInt("status");
String selectedAccount = args.getString("account");
String selectedName = args.getString("name");
@ -9760,6 +9760,11 @@ public class FragmentMessages extends FragmentBase
ICalendar icalendar = Biweekly.parse(calendar.getFile(context)).first();
VEvent event = icalendar.getEvents().get(0);
int status = CalendarContract.Events.STATUS_TENTATIVE;
if (event.getStatus() != null &&
Status.CONFIRMED.equals(event.getStatus().getValue()))
status = CalendarContract.Events.STATUS_CONFIRMED;
return CalendarHelper.insert(context, icalendar, event, status,
selectedAccount, selectedName, message);
}

Loading…
Cancel
Save