Clarify sharing state docs

This commit is contained in:
Torsten Grote
2023-01-20 11:13:17 -03:00
parent 429bbe1275
commit 9353b78da8
3 changed files with 6 additions and 4 deletions

View File

@@ -85,7 +85,8 @@ public interface GroupInvitationManager extends ConversationClient {
* This indicates whether the {@link PrivateGroup} can be shared
* with the contact.
*
* @throws ProtocolStateException if {@link PrivateGroup} was already left.
* @throws ProtocolStateException if {@link PrivateGroup}
* was already dissolved.
*/
SharingStatus getSharingStatus(Contact c, GroupId g) throws DbException;
}

View File

@@ -116,7 +116,7 @@ public interface SharingManager<S extends Shareable>
* This indicates whether the {@link Shareable} can be shared
* with the contact.
*
* @throws ProtocolStateException if {@link Shareable} was already left.
* @throws ProtocolStateException if we already left the {@link Shareable}.
*/
SharingStatus getSharingStatus(GroupId g, Contact c) throws DbException;
@@ -126,7 +126,7 @@ public interface SharingManager<S extends Shareable>
* This indicates whether the {@link Shareable} can be shared
* with the contact.
*
* @throws ProtocolStateException if {@link Shareable} was already left.
* @throws ProtocolStateException if we already left the {@link Shareable}.
*/
SharingStatus getSharingStatus(Transaction txn, GroupId g, Contact c)
throws DbException;

View File

@@ -539,7 +539,8 @@ class GroupInvitationManagerImpl extends ConversationClientImpl
if (state == START) return SharingStatus.SHAREABLE;
if (state == INVITED) return SharingStatus.INVITE_RECEIVED;
if (state == JOINED) return SharingStatus.SHARING;
// The creator can also be a LEFT state, after re-adding a contact
// Apart from the common case that the contact LEFT the group,
// the creator can also be a LEFT state, after re-adding a contact
// and re-creating the session with #recreateSession()
if (state == CreatorState.LEFT) return SharingStatus.SHARING;
if (state == DISSOLVED) throw new ProtocolStateException();