mirror of https://github.com/M66B/FairEmail.git
parent
29580f0eb6
commit
814e74db2d
|
@ -31,8 +31,6 @@ import android.text.TextUtils;
|
|||
|
||||
import androidx.preference.PreferenceManager;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -106,23 +104,6 @@ public class CalendarHelper {
|
|||
}
|
||||
}
|
||||
|
||||
static Long insert(Context context, ICalendar icalendar, VEvent event, int status,
|
||||
EntityAccount account, EntityMessage message) {
|
||||
String selectedAccount;
|
||||
String selectedName;
|
||||
try {
|
||||
JSONObject jselected = new JSONObject(account.calendar);
|
||||
selectedAccount = jselected.getString("account");
|
||||
selectedName = jselected.optString("name", null);
|
||||
} catch (Throwable ex) {
|
||||
Log.i(ex);
|
||||
selectedAccount = account.calendar;
|
||||
selectedName = null;
|
||||
}
|
||||
|
||||
return insert(context, icalendar, event, status, selectedAccount, selectedName, message);
|
||||
}
|
||||
|
||||
static Long insert(Context context, ICalendar icalendar, VEvent event, int status,
|
||||
String selectedAccount, String selectedName, EntityMessage message) {
|
||||
Long existId = null;
|
||||
|
|
|
@ -71,6 +71,7 @@ import org.bouncycastle.asn1.x509.AlgorithmIdentifier;
|
|||
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
|
||||
import org.commonmark.parser.Parser;
|
||||
import org.commonmark.renderer.html.HtmlRenderer;
|
||||
import org.json.JSONObject;
|
||||
import org.jsoup.nodes.Document;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.nodes.Node;
|
||||
|
@ -4466,7 +4467,19 @@ public class MessageHelper {
|
|||
return;
|
||||
}
|
||||
|
||||
CalendarHelper.insert(context, icalendar, event, status, account, message);
|
||||
String selectedAccount;
|
||||
String selectedName;
|
||||
try {
|
||||
JSONObject jselected = new JSONObject(account.calendar);
|
||||
selectedAccount = jselected.getString("account");
|
||||
selectedName = jselected.optString("name", null);
|
||||
} catch (Throwable ex) {
|
||||
Log.i(ex);
|
||||
selectedAccount = account.calendar;
|
||||
selectedName = null;
|
||||
}
|
||||
|
||||
CalendarHelper.insert(context, icalendar, event, status, selectedAccount, selectedName, message);
|
||||
} else
|
||||
EntityLog.log(context, "Unknown event method=" + method.getValue());
|
||||
} catch (Throwable ex) {
|
||||
|
|
Loading…
Reference in New Issue