mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 03:39:05 +01:00
Factor MessageTracker out of BdfIncomingMessageHook.
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
package org.briarproject.api.messaging;
|
||||
|
||||
import org.briarproject.api.clients.MessageTracker.GroupCount;
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.db.Transaction;
|
||||
import org.briarproject.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
@NotNullByDefault
|
||||
public interface ConversationManager {
|
||||
|
||||
/**
|
||||
@@ -13,11 +19,19 @@ public interface ConversationManager {
|
||||
*/
|
||||
void registerConversationClient(ConversationClient client);
|
||||
|
||||
/** Get the unified group count for all private conversation messages. */
|
||||
GroupCount getGroupCount(ContactId contactId) throws DbException;
|
||||
/**
|
||||
* Get the unified group count for all private conversation messages.
|
||||
*/
|
||||
GroupCount getGroupCount(ContactId c) throws DbException;
|
||||
|
||||
interface ConversationClient {
|
||||
GroupCount getGroupCount(Transaction txn, ContactId contactId)
|
||||
|
||||
Group getContactGroup(Contact c);
|
||||
|
||||
GroupCount getGroupCount(Transaction txn, ContactId c)
|
||||
throws DbException;
|
||||
|
||||
void setReadFlag(GroupId g, MessageId m, boolean read)
|
||||
throws DbException;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package org.briarproject.api.messaging;
|
||||
|
||||
import org.briarproject.api.clients.MessageTracker;
|
||||
import org.briarproject.api.contact.ContactId;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.messaging.ConversationManager.ConversationClient;
|
||||
import org.briarproject.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.api.sync.ClientId;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public interface MessagingManager extends MessageTracker {
|
||||
@NotNullByDefault
|
||||
public interface MessagingManager extends ConversationClient {
|
||||
|
||||
/** The unique ID of the messaging client. */
|
||||
ClientId CLIENT_ID = new ClientId("org.briarproject.briar.messaging");
|
||||
|
||||
Reference in New Issue
Block a user