Skip to content
Snippets Groups Projects
Unverified Commit da543c10 authored by akwizgran's avatar akwizgran
Browse files

Added javadocs, removed redundant exception.

parent 3a220512
No related branches found
No related tags found
Loading
...@@ -31,6 +31,8 @@ ...@@ -31,6 +31,8 @@
</value> </value>
</option> </option>
<option name="RIGHT_MARGIN" value="100" /> <option name="RIGHT_MARGIN" value="100" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
<AndroidXmlCodeStyleSettings> <AndroidXmlCodeStyleSettings>
<option name="USE_CUSTOM_SETTINGS" value="true" /> <option name="USE_CUSTOM_SETTINGS" value="true" />
</AndroidXmlCodeStyleSettings> </AndroidXmlCodeStyleSettings>
......
package org.briarproject.api.privategroup.invitation; package org.briarproject.api.privategroup.invitation;
import org.briarproject.api.clients.ProtocolStateException;
import org.briarproject.api.clients.SessionId; import org.briarproject.api.clients.SessionId;
import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.Contact;
import org.briarproject.api.contact.ContactId; import org.briarproject.api.contact.ContactId;
...@@ -26,18 +27,28 @@ public interface GroupInvitationManager { ...@@ -26,18 +27,28 @@ public interface GroupInvitationManager {
/** /**
* Sends an invitation to share the given private group with the given * Sends an invitation to share the given private group with the given
* contact, including an optional message. * contact, including an optional message.
*
* @throws ProtocolStateException if the group is no longer eligible to be
* shared with the contact, for example because an invitation is already
* pending.
*/ */
void sendInvitation(GroupId g, ContactId c, @Nullable String message, void sendInvitation(GroupId g, ContactId c, @Nullable String message,
long timestamp, byte[] signature) throws DbException; long timestamp, byte[] signature) throws DbException;
/** /**
* Responds to a pending private group invitation from the given contact. * Responds to a pending private group invitation from the given contact.
*
* @throws ProtocolStateException if the invitation is no longer pending,
* for example because the group has been dissolved.
*/ */
void respondToInvitation(ContactId c, PrivateGroup g, boolean accept) void respondToInvitation(ContactId c, PrivateGroup g, boolean accept)
throws DbException; throws DbException;
/** /**
* Responds to a pending private group invitation from the given contact. * Responds to a pending private group invitation from the given contact.
*
* @throws ProtocolStateException if the invitation is no longer pending,
* for example because the group has been dissolved.
*/ */
void respondToInvitation(ContactId c, SessionId s, boolean accept) void respondToInvitation(ContactId c, SessionId s, boolean accept)
throws DbException; throws DbException;
...@@ -45,6 +56,9 @@ public interface GroupInvitationManager { ...@@ -45,6 +56,9 @@ public interface GroupInvitationManager {
/** /**
* Makes the user's relationship with the given contact visible to the * Makes the user's relationship with the given contact visible to the
* given private group. * given private group.
*
* @throws ProtocolStateException if the relationship is no longer eligible
* to be revealed, for example because the contact has revealed it.
*/ */
void revealRelationship(ContactId c, GroupId g) throws DbException; void revealRelationship(ContactId c, GroupId g) throws DbException;
......
...@@ -459,9 +459,6 @@ class GroupInvitationManagerImpl extends ConversationClientImpl ...@@ -459,9 +459,6 @@ class GroupInvitationManagerImpl extends ConversationClientImpl
db.commitTransaction(txn); db.commitTransaction(txn);
// If there's no session, the contact can be invited // If there's no session, the contact can be invited
if (ss == null) return true; if (ss == null) return true;
// If there's a session, it should be a creator session
if (sessionParser.getRole(ss.bdfSession) != CREATOR)
throw new IllegalArgumentException();
// If the session's in the start state, the contact can be invited // If the session's in the start state, the contact can be invited
CreatorSession session = sessionParser CreatorSession session = sessionParser
.parseCreatorSession(contactGroupId, ss.bdfSession); .parseCreatorSession(contactGroupId, ss.bdfSession);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment