mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 21:29:54 +01:00
Address review comments
This commit is contained in:
@@ -81,8 +81,8 @@ public abstract class BdfIncomingMessageHook implements IncomingMessageHook,
|
||||
protected void trackMessage(Transaction txn, GroupId g, long time,
|
||||
boolean read) throws DbException {
|
||||
GroupCount c = getGroupCount(txn, g);
|
||||
long msgCount = c.getMsgCount() + 1;
|
||||
long unreadCount = c.getUnreadCount() + (read ? 0 : 1);
|
||||
int msgCount = c.getMsgCount() + 1;
|
||||
int unreadCount = c.getUnreadCount() + (read ? 0 : 1);
|
||||
long latestTime =
|
||||
time > c.getLatestMsgTime() ? time : c.getLatestMsgTime();
|
||||
storeGroupCount(txn, g,
|
||||
@@ -109,8 +109,8 @@ public abstract class BdfIncomingMessageHook implements IncomingMessageHook,
|
||||
try {
|
||||
BdfDictionary d = clientHelper.getGroupMetadataAsDictionary(txn, g);
|
||||
count = new GroupCount(
|
||||
d.getLong(GROUP_KEY_MSG_COUNT, 0L),
|
||||
d.getLong(GROUP_KEY_UNREAD_COUNT, 0L),
|
||||
d.getLong(GROUP_KEY_MSG_COUNT, 0L).intValue(),
|
||||
d.getLong(GROUP_KEY_UNREAD_COUNT, 0L).intValue(),
|
||||
d.getLong(GROUP_KEY_LATEST_MSG, 0L)
|
||||
);
|
||||
} catch (FormatException e) {
|
||||
|
||||
@@ -8,19 +8,18 @@ import org.briarproject.api.db.DatabaseComponent;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.db.Transaction;
|
||||
import org.briarproject.api.messaging.ConversationManager;
|
||||
import org.briarproject.api.messaging.ConversationManager.ConversationClient;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
|
||||
public abstract class ConversationClient extends BdfIncomingMessageHook
|
||||
implements ConversationManager.ConversationClient {
|
||||
public abstract class ConversationClientImpl extends BdfIncomingMessageHook
|
||||
implements ConversationClient {
|
||||
|
||||
protected ConversationClient(DatabaseComponent db,
|
||||
protected ConversationClientImpl(DatabaseComponent db,
|
||||
ClientHelper clientHelper, MetadataParser metadataParser) {
|
||||
super(db, clientHelper, metadataParser);
|
||||
}
|
||||
|
||||
// TODO overwrite super methods to store GroupCount data in a single group
|
||||
|
||||
protected abstract Group getContactGroup(Contact contact);
|
||||
|
||||
@Override
|
||||
Reference in New Issue
Block a user