Prepare private message retrieval through ConversationManager

This commit is contained in:
Torsten Grote
2018-09-04 19:04:19 -03:00
parent 59fae2fa3c
commit ffeca8817f
16 changed files with 155 additions and 94 deletions

View File

@@ -51,7 +51,8 @@ public interface IntroductionManager extends ConversationClient {
/**
* Returns all introduction messages for the given contact.
*/
Collection<PrivateMessageHeader> getIntroductionMessages(ContactId contactId)
@Deprecated
Collection<PrivateMessageHeader> getMessages(ContactId contactId)
throws DbException;
}

View File

@@ -10,6 +10,8 @@ import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.client.MessageTracker.GroupCount;
import java.util.Collection;
@NotNullByDefault
public interface ConversationManager {
@@ -19,6 +21,15 @@ public interface ConversationManager {
*/
void registerConversationClient(ConversationClient client);
/**
* Returns (the headers) of all messages in the given private conversation.
*
* Only {@link MessagingManager} returns only headers.
* The others also return the message body.
*/
Collection<PrivateMessageHeader> getMessages(ContactId c)
throws DbException;
/**
* Returns the unified group count for all private conversation messages.
*/
@@ -29,6 +40,9 @@ public interface ConversationManager {
Group getContactGroup(Contact c);
Collection<PrivateMessageHeader> getMessages(Transaction txn,
ContactId contactId) throws DbException;
GroupCount getGroupCount(Transaction txn, ContactId c)
throws DbException;

View File

@@ -46,7 +46,8 @@ public interface MessagingManager extends ConversationClient {
/**
* Returns the headers of all messages in the given private conversation.
*/
Collection<PrivateMessageHeader> getMessageHeaders(ContactId c)
@Deprecated
Collection<PrivateMessageHeader> getMessages(ContactId c)
throws DbException;
/**

View File

@@ -77,7 +77,8 @@ public interface GroupInvitationManager extends ConversationClient {
* Returns all private group invitation messages related to the given
* contact.
*/
Collection<PrivateMessageHeader> getInvitationMessages(ContactId c)
@Deprecated
Collection<PrivateMessageHeader> getMessages(ContactId c)
throws DbException;
/**

View File

@@ -40,8 +40,9 @@ public interface SharingManager<S extends Shareable>
* Returns all group sharing messages sent by the Contact
* identified by contactId.
*/
Collection<PrivateMessageHeader> getInvitationMessages(
ContactId contactId) throws DbException;
@Deprecated
Collection<PrivateMessageHeader> getMessages(ContactId contactId)
throws DbException;
/**
* Returns all invitations to groups.