Keep order of labels
This commit is contained in:
parent
3ab3d7a0ca
commit
5849e68d20
@ -543,7 +543,7 @@ public class Plaintext implements Streamable {
|
|||||||
private long sent;
|
private long sent;
|
||||||
private Long received;
|
private Long received;
|
||||||
private Status status;
|
private Status status;
|
||||||
private Set<Label> labels = new HashSet<>();
|
private Set<Label> labels = new LinkedHashSet<>();
|
||||||
private long ttl;
|
private long ttl;
|
||||||
private int retries;
|
private int retries;
|
||||||
private Long nextTry;
|
private Long nextTry;
|
||||||
|
@ -205,11 +205,11 @@ public class JdbcMessageRepository extends AbstractMessageRepository implements
|
|||||||
byte[] childIV = message.getInventoryVector().getHash();
|
byte[] childIV = message.getInventoryVector().getHash();
|
||||||
// save new parents
|
// save new parents
|
||||||
int order = 0;
|
int order = 0;
|
||||||
|
try (PreparedStatement ps = connection.prepareStatement("INSERT INTO Message_Parent VALUES (?, ?, ?, ?)")) {
|
||||||
for (InventoryVector parentIV : message.getParents()) {
|
for (InventoryVector parentIV : message.getParents()) {
|
||||||
Plaintext parent = getMessage(parentIV);
|
Plaintext parent = getMessage(parentIV);
|
||||||
mergeConversations(connection, parent.getConversationId(), message.getConversationId());
|
mergeConversations(connection, parent.getConversationId(), message.getConversationId());
|
||||||
order++;
|
order++;
|
||||||
try (PreparedStatement ps = connection.prepareStatement("INSERT INTO Message_Parent VALUES (?, ?, ?, ?)")) {
|
|
||||||
ps.setBytes(1, parentIV.getHash());
|
ps.setBytes(1, parentIV.getHash());
|
||||||
ps.setBytes(2, childIV);
|
ps.setBytes(2, childIV);
|
||||||
ps.setInt(3, order); // FIXME: this might not be necessary
|
ps.setInt(3, order); // FIXME: this might not be necessary
|
||||||
|
Loading…
Reference in New Issue
Block a user