mirror of https://github.com/M66B/FairEmail.git
Refactoring
This commit is contained in:
parent
be5f64011b
commit
4fb94f3cc5
|
@ -1424,7 +1424,7 @@ class Core {
|
||||||
else {
|
else {
|
||||||
msgid = helper.getMessageID();
|
msgid = helper.getMessageID();
|
||||||
if (existing.contains(msgid)) {
|
if (existing.contains(msgid)) {
|
||||||
List<EntityMessage> messages = db.message().getMessageByMsgId(account.id, msgid);
|
List<EntityMessage> messages = db.message().getMessagesByMsgId(account.id, msgid);
|
||||||
if (messages.size() == 1) {
|
if (messages.size() == 1) {
|
||||||
messages.get(0).msgid = uid;
|
messages.get(0).msgid = uid;
|
||||||
db.message().updateMessage(messages.get(0));
|
db.message().updateMessage(messages.get(0));
|
||||||
|
@ -2036,7 +2036,7 @@ class Core {
|
||||||
if (message == null) {
|
if (message == null) {
|
||||||
String msgid = helper.getMessageID();
|
String msgid = helper.getMessageID();
|
||||||
Log.i(folder.name + " searching for " + msgid);
|
Log.i(folder.name + " searching for " + msgid);
|
||||||
for (EntityMessage dup : db.message().getMessageByMsgId(folder.account, msgid)) {
|
for (EntityMessage dup : db.message().getMessagesByMsgId(folder.account, msgid)) {
|
||||||
EntityFolder dfolder = db.folder().getFolder(dup.folder);
|
EntityFolder dfolder = db.folder().getFolder(dup.folder);
|
||||||
Log.i(folder.name + " found as id=" + dup.id + "/" + dup.uid +
|
Log.i(folder.name + " found as id=" + dup.id + "/" + dup.uid +
|
||||||
" folder=" + dfolder.type + ":" + dup.folder + "/" + folder.type + ":" + folder.id +
|
" folder=" + dfolder.type + ":" + dup.folder + "/" + folder.type + ":" + folder.id +
|
||||||
|
|
|
@ -257,7 +257,7 @@ public interface DaoMessage {
|
||||||
@Query("SELECT * FROM message" +
|
@Query("SELECT * FROM message" +
|
||||||
" WHERE account = :account" +
|
" WHERE account = :account" +
|
||||||
" AND msgid = :msgid")
|
" AND msgid = :msgid")
|
||||||
List<EntityMessage> getMessageByMsgId(long account, String msgid);
|
List<EntityMessage> getMessagesByMsgId(long account, String msgid);
|
||||||
|
|
||||||
@Query("SELECT * FROM message" +
|
@Query("SELECT * FROM message" +
|
||||||
" WHERE account = :account" +
|
" WHERE account = :account" +
|
||||||
|
|
|
@ -517,7 +517,7 @@ public class MessageHelper {
|
||||||
|
|
||||||
DB db = DB.getInstance(context);
|
DB db = DB.getInstance(context);
|
||||||
for (String ref : refs) {
|
for (String ref : refs) {
|
||||||
List<EntityMessage> messages = db.message().getMessageByMsgId(account, ref);
|
List<EntityMessage> messages = db.message().getMessagesByMsgId(account, ref);
|
||||||
if (messages.size() > 0)
|
if (messages.size() > 0)
|
||||||
return messages.get(0).thread;
|
return messages.get(0).thread;
|
||||||
}
|
}
|
||||||
|
|
|
@ -442,7 +442,7 @@ public class ServiceSend extends ServiceBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message.inreplyto != null) {
|
if (message.inreplyto != null) {
|
||||||
List<EntityMessage> replieds = db.message().getMessageByMsgId(message.account, message.inreplyto);
|
List<EntityMessage> replieds = db.message().getMessagesByMsgId(message.account, message.inreplyto);
|
||||||
for (EntityMessage replied : replieds)
|
for (EntityMessage replied : replieds)
|
||||||
EntityOperation.queue(this, replied, EntityOperation.ANSWERED, true);
|
EntityOperation.queue(this, replied, EntityOperation.ANSWERED, true);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue