|
|
|
@ -661,11 +661,12 @@ class Core {
|
|
|
|
|
if (msgid == null)
|
|
|
|
|
throw new IllegalArgumentException("Message ID missing");
|
|
|
|
|
|
|
|
|
|
long uid = -1;
|
|
|
|
|
if (istore.hasCapability("UIDPLUS")) {
|
|
|
|
|
AppendUID[] uids = ifolder.appendUIDMessages(new Message[]{imessage});
|
|
|
|
|
if (uids != null && uids.length > 0) {
|
|
|
|
|
Log.i("Appended uid=" + uids[0].uid);
|
|
|
|
|
return uids[0].uid;
|
|
|
|
|
uid = uids[0].uid;
|
|
|
|
|
}
|
|
|
|
|
} else
|
|
|
|
|
ifolder.appendMessages(new Message[]{imessage});
|
|
|
|
@ -674,9 +675,8 @@ class Core {
|
|
|
|
|
ifolder.close(false);
|
|
|
|
|
ifolder.open(Folder.READ_WRITE);
|
|
|
|
|
|
|
|
|
|
if (uid <= 0) {
|
|
|
|
|
Log.i("Searching for appended msgid=" + msgid);
|
|
|
|
|
|
|
|
|
|
long uid = -1;
|
|
|
|
|
Message[] messages = ifolder.search(new MessageIDTerm(msgid));
|
|
|
|
|
if (messages != null)
|
|
|
|
|
for (Message iappended : messages) {
|
|
|
|
@ -686,8 +686,9 @@ class Core {
|
|
|
|
|
if (muid > uid)
|
|
|
|
|
uid = muid;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (uid < 0)
|
|
|
|
|
if (uid <= 0)
|
|
|
|
|
throw new IllegalArgumentException("uid not found");
|
|
|
|
|
|
|
|
|
|
return uid;
|
|
|
|
|