From da543c100421c38abbcd54ca74627a4e2a2d9a49 Mon Sep 17 00:00:00 2001 From: akwizgran <akwizgran@users.sourceforge.net> Date: Mon, 14 Nov 2016 10:30:38 +0000 Subject: [PATCH] Added javadocs, removed redundant exception. --- .idea/codeStyleSettings.xml | 2 ++ .../invitation/GroupInvitationManager.java | 14 ++++++++++++++ .../invitation/GroupInvitationManagerImpl.java | 3 --- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.idea/codeStyleSettings.xml b/.idea/codeStyleSettings.xml index 2feaa4e95f..a7a72e1fbf 100644 --- a/.idea/codeStyleSettings.xml +++ b/.idea/codeStyleSettings.xml @@ -31,6 +31,8 @@ </value> </option> <option name="RIGHT_MARGIN" value="100" /> + <option name="JD_ALIGN_PARAM_COMMENTS" value="false" /> + <option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" /> <AndroidXmlCodeStyleSettings> <option name="USE_CUSTOM_SETTINGS" value="true" /> </AndroidXmlCodeStyleSettings> diff --git a/briar-api/src/org/briarproject/api/privategroup/invitation/GroupInvitationManager.java b/briar-api/src/org/briarproject/api/privategroup/invitation/GroupInvitationManager.java index 2a4d4539f3..59475c9749 100644 --- a/briar-api/src/org/briarproject/api/privategroup/invitation/GroupInvitationManager.java +++ b/briar-api/src/org/briarproject/api/privategroup/invitation/GroupInvitationManager.java @@ -1,5 +1,6 @@ package org.briarproject.api.privategroup.invitation; +import org.briarproject.api.clients.ProtocolStateException; import org.briarproject.api.clients.SessionId; import org.briarproject.api.contact.Contact; import org.briarproject.api.contact.ContactId; @@ -26,18 +27,28 @@ public interface GroupInvitationManager { /** * Sends an invitation to share the given private group with the given * 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, long timestamp, byte[] signature) throws DbException; /** * 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) throws DbException; /** * 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) throws DbException; @@ -45,6 +56,9 @@ public interface GroupInvitationManager { /** * Makes the user's relationship with the given contact visible to the * 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; diff --git a/briar-core/src/org/briarproject/privategroup/invitation/GroupInvitationManagerImpl.java b/briar-core/src/org/briarproject/privategroup/invitation/GroupInvitationManagerImpl.java index bc6dd88f6d..d4a51798f1 100644 --- a/briar-core/src/org/briarproject/privategroup/invitation/GroupInvitationManagerImpl.java +++ b/briar-core/src/org/briarproject/privategroup/invitation/GroupInvitationManagerImpl.java @@ -459,9 +459,6 @@ class GroupInvitationManagerImpl extends ConversationClientImpl db.commitTransaction(txn); // If there's no session, the contact can be invited 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 CreatorSession session = sessionParser .parseCreatorSession(contactGroupId, ss.bdfSession); -- GitLab