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

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

@ -5967,8 +5967,7 @@ 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))
for (EntityMessage m : db.message().getMessagesByMsgId(message.account, message.inreplyto))
map.put(m.msgid, m);
if (!TextUtils.isEmpty(message.references))
@ -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,9 +4248,8 @@ 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 (message.inreplyto != null) {
List<EntityMessage> replied = db.message().getMessagesByMsgId(folder.account, message.inreplyto);
if (replied != null)
all.addAll(replied);
}
@ -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,9 +6458,8 @@ 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 (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,8 +7951,12 @@ public class FragmentCompose extends FragmentBase {
return false;
}
for (String inreplyto : draft.inreplyto.split(" ")) {
List<EntityMessage> messages = db.message().getMessagesByMsgId(draft.account, inreplyto);
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)
@ -7961,7 +7964,6 @@ public class FragmentCompose extends FragmentBase {
if (EntityFolder.INBOX.equals(folder.type) || EntityFolder.USER.equals(folder.type))
return true;
}
}
args.putString("reason", "Not in inbox or unread");
return false;

@ -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,9 +566,8 @@ 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 (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) {
@ -581,8 +580,6 @@ public class ServiceSend extends ServiceBase implements SharedPreferences.OnShar
break;
}
}
if (sent != null)
break;
}
if (sent == null)
@ -808,9 +805,8 @@ 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);
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);
}

Loading…
Cancel
Save