mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-11 18:29:05 +01:00
Remove new member announcement and add signature to invitation
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
package org.briarproject.api.clients;
|
||||
|
||||
import org.briarproject.api.contact.Contact;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
import org.briarproject.api.sync.ClientId;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupFactory;
|
||||
|
||||
public interface ContactGroupFactory {
|
||||
|
||||
@@ -13,4 +13,11 @@ public interface ContactGroupFactory {
|
||||
/** Creates a group for the given client to share with the given contact. */
|
||||
Group createContactGroup(ClientId clientId, Contact contact);
|
||||
|
||||
/**
|
||||
* Creates a group for the given client to share between the given authors
|
||||
* identified by their AuthorIds.
|
||||
*/
|
||||
Group createContactGroup(ClientId clientId, AuthorId authorId1,
|
||||
AuthorId authorId2);
|
||||
|
||||
}
|
||||
|
||||
@@ -10,33 +10,29 @@ import org.jetbrains.annotations.Nullable;
|
||||
public interface GroupMessageFactory {
|
||||
|
||||
/**
|
||||
* Creates a new member announcement that contains the joiner's identity
|
||||
* and is signed by the creator.
|
||||
* <p>
|
||||
* When a new member accepts an invitation to the group,
|
||||
* the creator sends this new member announcement to the group.
|
||||
*
|
||||
* @param groupId The ID of the group the new member joined
|
||||
* @param timestamp The current timestamp
|
||||
* @param creator The creator of the group with {@param groupId}
|
||||
* @param member The new member that has just accepted an invitation
|
||||
*/
|
||||
@CryptoExecutor
|
||||
GroupMessage createNewMemberMessage(GroupId groupId, long timestamp,
|
||||
LocalAuthor creator, Author member);
|
||||
|
||||
/**
|
||||
* Creates a join announcement message
|
||||
* that depends on a previous new member announcement.
|
||||
* Creates a join announcement message for the creator of a group.
|
||||
*
|
||||
* @param groupId The ID of the Group that is being joined
|
||||
* @param timestamp Must be equal to the timestamp of the new member message
|
||||
* @param member Our own LocalAuthor
|
||||
* @param newMemberId The MessageId of the new member message
|
||||
* @param timestamp Must be greater than the timestamp of the invitation message
|
||||
* @param creator The creator's LocalAuthor
|
||||
*/
|
||||
@CryptoExecutor
|
||||
GroupMessage createJoinMessage(GroupId groupId, long timestamp,
|
||||
LocalAuthor member, MessageId newMemberId);
|
||||
LocalAuthor creator);
|
||||
|
||||
/**
|
||||
* Creates a join announcement message for a joining member.
|
||||
*
|
||||
* @param groupId The ID of the Group that is being joined
|
||||
* @param timestamp Must be greater than the timestamp of the
|
||||
* invitation message
|
||||
* @param member The member's LocalAuthor
|
||||
* @param inviteTimestamp The timestamp of the group invitation message
|
||||
* @param creatorSignature The creator's signature from the group invitation
|
||||
*/
|
||||
@CryptoExecutor
|
||||
GroupMessage createJoinMessage(GroupId groupId, long timestamp,
|
||||
LocalAuthor member, long inviteTimestamp, byte[] creatorSignature);
|
||||
|
||||
/**
|
||||
* Creates a group message
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package org.briarproject.api.privategroup;
|
||||
|
||||
public enum MessageType {
|
||||
NEW_MEMBER(0),
|
||||
JOIN(1),
|
||||
POST(2);
|
||||
JOIN(0),
|
||||
POST(1);
|
||||
|
||||
int value;
|
||||
|
||||
|
||||
@@ -21,12 +21,10 @@ public interface PrivateGroupManager extends MessageTracker {
|
||||
* Adds a new private group and joins it.
|
||||
*
|
||||
* @param group The private group to add
|
||||
* @param newMemberMsg The creator's message announcing herself as
|
||||
* first new member
|
||||
* @param joinMsg The creator's own join message
|
||||
*/
|
||||
void addPrivateGroup(PrivateGroup group, GroupMessage newMemberMsg,
|
||||
GroupMessage joinMsg) throws DbException;
|
||||
void addPrivateGroup(PrivateGroup group, GroupMessage joinMsg)
|
||||
throws DbException;
|
||||
|
||||
/** Removes a dissolved private group. */
|
||||
void removePrivateGroup(GroupId g) throws DbException;
|
||||
|
||||
Reference in New Issue
Block a user