mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 19:29:06 +01:00
Forum Sharing Client backend
This commit replaces the old ForumSharingManagerImpl with a new one which is based on state machines and the ProtocolEngine. There is a SharerEngine and a InviteeEngine that take care of state transitions, messages, events and trigger actions to be carried out by the ForumSharingManagerImpl. This is all very similar to the Introduction Client. The general sharing paradigm has been changed from sharing as a state to sharing as an action. Now the UI can allow users to invite contacts to forums. The contacts can accept or decline the invitiation. Also, the Forum Sharing Manger is notified when users leave a forum. Closes #322
This commit is contained in:
@@ -1,61 +1,36 @@
|
||||
package org.briarproject.api.introduction;
|
||||
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.messaging.BaseMessage;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRODUCEE;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRODUCER;
|
||||
|
||||
abstract public class IntroductionMessage {
|
||||
public class IntroductionMessage extends BaseMessage {
|
||||
|
||||
private final SessionId sessionId;
|
||||
private final MessageId messageId;
|
||||
private final int role;
|
||||
private final long time;
|
||||
private final boolean local, sent, seen, read;
|
||||
|
||||
public IntroductionMessage(SessionId sessionId, MessageId messageId,
|
||||
int role, long time, boolean local, boolean sent, boolean seen,
|
||||
boolean read) {
|
||||
|
||||
super(messageId, time, local, read, sent, seen);
|
||||
this.sessionId = sessionId;
|
||||
this.messageId = messageId;
|
||||
this.role = role;
|
||||
this.time = time;
|
||||
this.local = local;
|
||||
this.sent = sent;
|
||||
this.seen = seen;
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public SessionId getSessionId() {
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public MessageId getMessageId() {
|
||||
return messageId;
|
||||
}
|
||||
|
||||
public boolean isLocal() {
|
||||
return local;
|
||||
}
|
||||
|
||||
public boolean isSent() {
|
||||
return sent;
|
||||
}
|
||||
|
||||
public boolean isSeen() {
|
||||
return seen;
|
||||
}
|
||||
|
||||
public boolean isRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public boolean isIntroducer() {
|
||||
return role == ROLE_INTRODUCER;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user