mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Send newest messages first.
This removes the need to send a start time for each subscription; new subscribers will receive old messages if and only if there's bandwidth.
This commit is contained in:
@@ -1363,8 +1363,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
+ " JOIN statuses AS s"
|
||||
+ " ON m.messageId = s.messageId"
|
||||
+ " WHERE m.contactId = ? AND status = ?"
|
||||
+ " ORDER BY timestamp"
|
||||
+ " LIMIT ?";
|
||||
+ " ORDER BY timestamp DESC LIMIT ?";
|
||||
ps = txn.prepareStatement(sql);
|
||||
ps.setInt(1, c.getInt());
|
||||
ps.setShort(2, (short) Status.NEW.ordinal());
|
||||
@@ -1392,8 +1391,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
+ " AND timestamp >= expiry"
|
||||
+ " AND status = ?"
|
||||
+ " AND sendability > ZERO()"
|
||||
+ " ORDER BY timestamp"
|
||||
+ " LIMIT ?";
|
||||
+ " ORDER BY timestamp DESC LIMIT ?";
|
||||
ps = txn.prepareStatement(sql);
|
||||
ps.setInt(1, c.getInt());
|
||||
ps.setShort(2, (short) Status.NEW.ordinal());
|
||||
@@ -1621,7 +1619,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
+ " JOIN statuses AS s"
|
||||
+ " ON m.messageId = s.messageId"
|
||||
+ " WHERE m.contactId = ? AND status = ?"
|
||||
+ " ORDER BY timestamp";
|
||||
+ " ORDER BY timestamp DESC";
|
||||
ps = txn.prepareStatement(sql);
|
||||
ps.setInt(1, c.getInt());
|
||||
ps.setShort(2, (short) Status.NEW.ordinal());
|
||||
@@ -1653,7 +1651,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
+ " AND timestamp >= expiry"
|
||||
+ " AND status = ?"
|
||||
+ " AND sendability > ZERO()"
|
||||
+ " ORDER BY timestamp";
|
||||
+ " ORDER BY timestamp DESC";
|
||||
ps = txn.prepareStatement(sql);
|
||||
ps.setInt(1, c.getInt());
|
||||
ps.setShort(2, (short) Status.NEW.ordinal());
|
||||
|
||||
Reference in New Issue
Block a user