Revert "Added In-reply-to multi address support"

This reverts commit c9ff506dab.
pull/208/head
M66B 3 years ago
parent 2d6949a0cb
commit 53d2151b77

@ -5967,9 +5967,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
return null;
if (!TextUtils.isEmpty(message.inreplyto))
for (String inreplyto : message.inreplyto.split(" "))
for (EntityMessage m : db.message().getMessagesByMsgId(message.account, inreplyto))
map.put(m.msgid, m);
for (EntityMessage m : db.message().getMessagesByMsgId(message.account, message.inreplyto))
map.put(m.msgid, m);
if (!TextUtils.isEmpty(message.references))
for (String ref : message.references.split(" "))
@ -5994,8 +5993,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
start = ssb.length();
ssb.append("In-reply-to: ");
ssb.setSpan(new StyleSpan(Typeface.BOLD), start, ssb.length(), 0);
for (String inreplyto : message.inreplyto.split(" "))
ssb.append(inreplyto).append("\n");
ssb.append(message.inreplyto).append("\n");
}
if (!TextUtils.isEmpty(message.references)) {

@ -4248,12 +4248,11 @@ class Core {
List<EntityMessage> all = new ArrayList<>();
if (message.inreplyto != null)
for (String inreplyto : message.inreplyto.split(" ")) {
List<EntityMessage> replied = db.message().getMessagesByMsgId(folder.account, inreplyto);
if (replied != null)
all.addAll(replied);
}
if (message.inreplyto != null) {
List<EntityMessage> replied = db.message().getMessagesByMsgId(folder.account, message.inreplyto);
if (replied != null)
all.addAll(replied);
}
if (r.refid != null) {
List<EntityMessage> refs = db.message().getMessagesByMsgId(folder.account, r.refid);
if (refs != null)
@ -4268,8 +4267,7 @@ class Core {
}
for (EntityFolder f : map.values())
for (String inreplyto : message.inreplyto.split(" "))
EntityOperation.queue(context, f, EntityOperation.REPORT, inreplyto, label);
EntityOperation.queue(context, f, EntityOperation.REPORT, message.inreplyto, label);
}
}
} catch (Throwable ex) {

@ -6458,13 +6458,12 @@ public class FragmentCompose extends FragmentBase {
if (extras.getBoolean("archive")) {
EntityFolder archive = db.folder().getFolderByType(draft.account, EntityFolder.ARCHIVE);
if (archive != null)
for (String inreplyto : draft.inreplyto.split(" ")) {
List<EntityMessage> messages = db.message().getMessagesByMsgId(draft.account, inreplyto);
if (messages != null)
for (EntityMessage message : messages)
EntityOperation.queue(context, message, EntityOperation.MOVE, archive.id);
}
if (archive != null) {
List<EntityMessage> messages = db.message().getMessagesByMsgId(draft.account, draft.inreplyto);
if (messages != null)
for (EntityMessage message : messages)
EntityOperation.queue(context, message, EntityOperation.MOVE, archive.id);
}
}
}
}
@ -7952,15 +7951,18 @@ public class FragmentCompose extends FragmentBase {
return false;
}
for (String inreplyto : draft.inreplyto.split(" ")) {
List<EntityMessage> messages = db.message().getMessagesByMsgId(draft.account, inreplyto);
for (EntityMessage message : messages) {
EntityFolder folder = db.folder().getFolder(message.folder);
if (folder == null)
continue;
if (EntityFolder.INBOX.equals(folder.type) || EntityFolder.USER.equals(folder.type))
return true;
}
List<EntityMessage> messages = db.message().getMessagesByMsgId(draft.account, draft.inreplyto);
if (messages == null || messages.size() == 0) {
args.putString("reason", "In-reply-to gone");
return false;
}
for (EntityMessage message : messages) {
EntityFolder folder = db.folder().getFolder(message.folder);
if (folder == null)
continue;
if (EntityFolder.INBOX.equals(folder.type) || EntityFolder.USER.equals(folder.type))
return true;
}
args.putString("reason", "Not in inbox or unread");

@ -1316,7 +1316,7 @@ public class MessageHelper {
String getInReplyTo() throws MessagingException {
String[] a = getInReplyTos();
return (a.length == 0 ? null : TextUtils.join(" ", a));
return (a.length < 1 ? null : a[0]);
}
String[] getInReplyTos() throws MessagingException {

@ -566,24 +566,21 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
Long sid = null;
EntityFolder sent = null;
if (reply_move && !TextUtils.isEmpty(message.inreplyto))
for (String inreplyto : message.inreplyto.split(" ")) {
List<EntityMessage> replied = db.message().getMessagesByMsgId(message.account, inreplyto);
if (replied != null)
for (EntityMessage m : replied)
if (!m.ui_hide) {
EntityFolder folder = db.folder().getFolder(m.folder);
if (folder != null &&
(EntityFolder.INBOX.equals(folder.type) ||
EntityFolder.ARCHIVE.equals(folder.type) ||
EntityFolder.USER.equals(folder.type))) {
sent = folder;
break;
}
if (reply_move && !TextUtils.isEmpty(message.inreplyto)) {
List<EntityMessage> replied = db.message().getMessagesByMsgId(message.account, message.inreplyto);
if (replied != null)
for (EntityMessage m : replied)
if (!m.ui_hide) {
EntityFolder folder = db.folder().getFolder(m.folder);
if (folder != null &&
(EntityFolder.INBOX.equals(folder.type) ||
EntityFolder.ARCHIVE.equals(folder.type) ||
EntityFolder.USER.equals(folder.type))) {
sent = folder;
break;
}
if (sent != null)
break;
}
}
}
if (sent == null)
sent = db.folder().getFolderByType(message.account, EntityFolder.SENT);
@ -808,12 +805,11 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
}
// Mark replied
if (message.inreplyto != null)
for (String inreplyto : message.inreplyto.split(" ")) {
List<EntityMessage> replieds = db.message().getMessagesByMsgId(message.account, inreplyto);
for (EntityMessage replied : replieds)
EntityOperation.queue(this, replied, EntityOperation.ANSWERED, true);
}
if (message.inreplyto != null) {
List<EntityMessage> replieds = db.message().getMessagesByMsgId(message.account, message.inreplyto);
for (EntityMessage replied : replieds)
EntityOperation.queue(this, replied, EntityOperation.ANSWERED, true);
}
// Mark forwarded
if (message.wasforwardedfrom != null) {

Loading…
Cancel
Save