mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Introduce SharingStatus to report more fine-grained status
This commit is contained in:
@@ -9,6 +9,7 @@ import org.briarproject.briar.api.client.ProtocolStateException;
|
||||
import org.briarproject.briar.api.client.SessionId;
|
||||
import org.briarproject.briar.api.conversation.ConversationManager.ConversationClient;
|
||||
import org.briarproject.briar.api.privategroup.PrivateGroup;
|
||||
import org.briarproject.briar.api.sharing.SharingManager.SharingStatus;
|
||||
import org.briarproject.nullsafety.NotNullByDefault;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -82,5 +83,5 @@ public interface GroupInvitationManager extends ConversationClient {
|
||||
* Returns true if the given contact can be invited to the given private
|
||||
* group.
|
||||
*/
|
||||
boolean isInvitationAllowed(Contact c, GroupId g) throws DbException;
|
||||
SharingStatus getSharingStatus(Contact c, GroupId g) throws DbException;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ import javax.annotation.Nullable;
|
||||
public interface SharingManager<S extends Shareable>
|
||||
extends ConversationClient {
|
||||
|
||||
enum SharingStatus {
|
||||
SHAREABLE, INVITED, SHARING, NOT_SUPPORTED
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends an invitation to share the given group with the given contact,
|
||||
* including optional text.
|
||||
@@ -80,12 +84,12 @@ public interface SharingManager<S extends Shareable>
|
||||
/**
|
||||
* Returns true if the group not already shared and no invitation is open
|
||||
*/
|
||||
boolean canBeShared(GroupId g, Contact c) throws DbException;
|
||||
SharingStatus getSharingStatus(GroupId g, Contact c) throws DbException;
|
||||
|
||||
/**
|
||||
* Returns true if the group not already shared and no invitation is open
|
||||
*/
|
||||
boolean canBeShared(Transaction txn, GroupId g, Contact c)
|
||||
SharingStatus getSharingStatus(Transaction txn, GroupId g, Contact c)
|
||||
throws DbException;
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user