mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 06:39:54 +01:00
Merge branch '542-include-requested-messages' into 'master'
Include requested messages when getting next send time See merge request akwizgran/briar!704
This commit is contained in:
@@ -1938,8 +1938,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
|||||||
String sql = "SELECT expiry FROM statuses"
|
String sql = "SELECT expiry FROM statuses"
|
||||||
+ " WHERE contactId = ? AND state = ?"
|
+ " WHERE contactId = ? AND state = ?"
|
||||||
+ " AND groupShared = TRUE AND messageShared = TRUE"
|
+ " AND groupShared = TRUE AND messageShared = TRUE"
|
||||||
+ " AND deleted = FALSE"
|
+ " AND deleted = FALSE AND seen = FALSE"
|
||||||
+ " AND seen = FALSE AND requested = FALSE"
|
|
||||||
+ " ORDER BY expiry LIMIT 1";
|
+ " ORDER BY expiry LIMIT 1";
|
||||||
ps = txn.prepareStatement(sql);
|
ps = txn.prepareStatement(sql);
|
||||||
ps.setInt(1, c.getInt());
|
ps.setInt(1, c.getInt());
|
||||||
|
|||||||
@@ -1653,6 +1653,10 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
|||||||
db.setMessageShared(txn, messageId);
|
db.setMessageShared(txn, messageId);
|
||||||
assertEquals(0, db.getNextSendTime(txn, contactId));
|
assertEquals(0, db.getNextSendTime(txn, contactId));
|
||||||
|
|
||||||
|
// Mark the message as requested - it should still be sendable
|
||||||
|
db.raiseRequestedFlag(txn, contactId, messageId);
|
||||||
|
assertEquals(0, db.getNextSendTime(txn, contactId));
|
||||||
|
|
||||||
// Update the message's expiry time as though we sent it - now the
|
// Update the message's expiry time as though we sent it - now the
|
||||||
// message should be sendable after one round-trip
|
// message should be sendable after one round-trip
|
||||||
db.updateExpiryTime(txn, contactId, messageId, 1000);
|
db.updateExpiryTime(txn, contactId, messageId, 1000);
|
||||||
|
|||||||
Reference in New Issue
Block a user