Commit 29758b17 authored by Torsten Grote's avatar Torsten Grote

Unify all events related to private messages

parent 61e18f10
......@@ -41,13 +41,9 @@ import org.briarproject.briar.android.util.BriarNotificationBuilder;
import org.briarproject.briar.api.android.AndroidNotificationManager;
import org.briarproject.briar.api.blog.event.BlogPostAddedEvent;
import org.briarproject.briar.api.forum.event.ForumPostReceivedEvent;
import org.briarproject.briar.api.introduction.event.IntroductionRequestReceivedEvent;
import org.briarproject.briar.api.introduction.event.IntroductionResponseReceivedEvent;
import org.briarproject.briar.api.introduction.event.IntroductionSucceededEvent;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.privategroup.event.GroupMessageAddedEvent;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import java.util.Set;
import java.util.concurrent.Callable;
......@@ -235,19 +231,6 @@ class AndroidNotificationManagerImpl implements AndroidNotificationManager,
} else if (e instanceof BlogPostAddedEvent) {
BlogPostAddedEvent b = (BlogPostAddedEvent) e;
showBlogPostNotification(b.getGroupId());
} else if (e instanceof IntroductionRequestReceivedEvent) {
ContactId c = ((IntroductionRequestReceivedEvent) e).getContactId();
showContactNotification(c);
} else if (e instanceof IntroductionResponseReceivedEvent) {
ContactId c =
((IntroductionResponseReceivedEvent) e).getContactId();
showContactNotification(c);
} else if (e instanceof InvitationRequestReceivedEvent) {
ContactId c = ((InvitationRequestReceivedEvent) e).getContactId();
showContactNotification(c);
} else if (e instanceof InvitationResponseReceivedEvent) {
ContactId c = ((InvitationResponseReceivedEvent) e).getContactId();
showContactNotification(c);
} else if (e instanceof IntroductionSucceededEvent) {
showIntroductionNotification();
}
......
......@@ -107,7 +107,7 @@ class BlogControllerImpl extends BaseControllerImpl
} else if (e instanceof BlogInvitationResponseReceivedEvent) {
BlogInvitationResponseReceivedEvent b =
(BlogInvitationResponseReceivedEvent) e;
PrivateResponse<Blog> r = b.getResponse();
PrivateResponse<Blog> r = b.getMessageHeader();
if (r.getObject().getId().equals(groupId) && r.wasAccepted()) {
LOG.info("Blog invitation accepted");
onBlogInvitationAccepted(b.getContactId());
......
......@@ -37,17 +37,9 @@ import org.briarproject.briar.android.keyagreement.ContactExchangeActivity;
import org.briarproject.briar.android.view.BriarRecyclerView;
import org.briarproject.briar.api.android.AndroidNotificationManager;
import org.briarproject.briar.api.client.MessageTracker.GroupCount;
import org.briarproject.briar.api.introduction.IntroductionRequest;
import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.introduction.event.IntroductionRequestReceivedEvent;
import org.briarproject.briar.api.introduction.event.IntroductionResponseReceivedEvent;
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import java.util.ArrayList;
import java.util.List;
......@@ -255,30 +247,6 @@ public class ContactListFragment extends BaseFragment implements EventListener {
PrivateMessageReceivedEvent p = (PrivateMessageReceivedEvent) e;
PrivateMessageHeader h = p.getMessageHeader();
updateItem(p.getContactId(), h);
} else if (e instanceof IntroductionRequestReceivedEvent) {
LOG.info("Introduction request received, updating item");
IntroductionRequestReceivedEvent m =
(IntroductionRequestReceivedEvent) e;
IntroductionRequest ir = m.getIntroductionRequest();
updateItem(m.getContactId(), ir);
} else if (e instanceof IntroductionResponseReceivedEvent) {
LOG.info("Introduction response received, updating item");
IntroductionResponseReceivedEvent m =
(IntroductionResponseReceivedEvent) e;
IntroductionResponse ir = m.getIntroductionResponse();
updateItem(m.getContactId(), ir);
} else if (e instanceof InvitationRequestReceivedEvent) {
LOG.info("Invitation Request received, update item");
InvitationRequestReceivedEvent m =
(InvitationRequestReceivedEvent) e;
PrivateRequest ir = m.getRequest();
updateItem(m.getContactId(), ir);
} else if (e instanceof InvitationResponseReceivedEvent) {
LOG.info("Invitation response received, updating item");
InvitationResponseReceivedEvent m =
(InvitationResponseReceivedEvent) e;
PrivateResponse ir = m.getResponse();
updateItem(m.getContactId(), ir);
}
}
......
......@@ -64,8 +64,6 @@ import org.briarproject.briar.api.forum.ForumSharingManager;
import org.briarproject.briar.api.introduction.IntroductionManager;
import org.briarproject.briar.api.introduction.IntroductionRequest;
import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.introduction.event.IntroductionRequestReceivedEvent;
import org.briarproject.briar.api.introduction.event.IntroductionResponseReceivedEvent;
import org.briarproject.briar.api.messaging.MessagingManager;
import org.briarproject.briar.api.messaging.PrivateMessage;
import org.briarproject.briar.api.messaging.PrivateMessageFactory;
......@@ -74,8 +72,6 @@ import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationManager;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import org.thoughtcrime.securesms.components.util.FutureTaskListener;
import org.thoughtcrime.securesms.components.util.ListenableFutureTask;
......@@ -474,9 +470,7 @@ public class ConversationActivity extends BriarActivity
PrivateMessageReceivedEvent p = (PrivateMessageReceivedEvent) e;
if (p.getContactId().equals(contactId)) {
LOG.info("Message received, adding");
PrivateMessageHeader h = p.getMessageHeader();
addConversationItem(ConversationItem.from(h));
loadMessageBody(h.getId());
onNewPrivateMessage(p.getMessageHeader());
}
} else if (e instanceof MessagesSentEvent) {
MessagesSentEvent m = (MessagesSentEvent) e;
......@@ -502,38 +496,6 @@ public class ConversationActivity extends BriarActivity
LOG.info("Contact disconnected");
displayContactOnlineStatus();
}
} else if (e instanceof IntroductionRequestReceivedEvent) {
IntroductionRequestReceivedEvent event =
(IntroductionRequestReceivedEvent) e;
if (event.getContactId().equals(contactId)) {
LOG.info("Introduction request received, adding...");
PrivateRequest ir = event.getIntroductionRequest();
handlePrivateRequest(ir);
}
} else if (e instanceof IntroductionResponseReceivedEvent) {
IntroductionResponseReceivedEvent event =
(IntroductionResponseReceivedEvent) e;
if (event.getContactId().equals(contactId)) {
LOG.info("Introduction response received, adding...");
PrivateResponse ir = event.getIntroductionResponse();
handlePrivateResponse(ir);
}
} else if (e instanceof InvitationRequestReceivedEvent) {
InvitationRequestReceivedEvent event =
(InvitationRequestReceivedEvent) e;
if (event.getContactId().equals(contactId)) {
LOG.info("Invitation received, adding...");
PrivateRequest ir = event.getRequest();
handlePrivateRequest(ir);
}
} else if (e instanceof InvitationResponseReceivedEvent) {
InvitationResponseReceivedEvent event =
(InvitationResponseReceivedEvent) e;
if (event.getContactId().equals(contactId)) {
LOG.info("Invitation response received, adding...");
PrivateResponse ir = event.getResponse();
handlePrivateResponse(ir);
}
}
}
......@@ -546,42 +508,44 @@ public class ConversationActivity extends BriarActivity
});
}
private void handlePrivateRequest(PrivateRequest m) {
getContactNameTask().addListener(new FutureTaskListener<String>() {
@Override
public void onSuccess(String contactName) {
runOnUiThreadUnlessDestroyed(() -> {
ConversationItem item = ConversationItem
.from(ConversationActivity.this, contactName, m);
addConversationItem(item);
});
}
private void onNewPrivateMessage(PrivateMessageHeader h) {
if (h instanceof PrivateRequest || h instanceof PrivateResponse) {
getContactNameTask().addListener(new FutureTaskListener<String>() {
@Override
public void onSuccess(String contactName) {
runOnUiThreadUnlessDestroyed(() -> {
handlePrivateRequestAndResponse(h, contactName);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
() -> handleDbException((DbException) exception));
}
});
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
() -> handleDbException((DbException) exception));
}
});
} else {
addConversationItem(ConversationItem.from(h));
loadMessageBody(h.getId());
}
}
private void handlePrivateResponse(PrivateResponse m) {
getContactNameTask().addListener(new FutureTaskListener<String>() {
@Override
public void onSuccess(String contactName) {
runOnUiThreadUnlessDestroyed(() -> {
ConversationItem item = ConversationItem
.from(ConversationActivity.this, contactName, m);
addConversationItem(item);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
() -> handleDbException((DbException) exception));
}
});
@UiThread
private void handlePrivateRequestAndResponse(PrivateMessageHeader h,
String contactName) {
ConversationItem item;
if (h instanceof PrivateRequest) {
PrivateRequest m = (PrivateRequest) h;
item = ConversationItem
.from(ConversationActivity.this, contactName, m);
} else if (h instanceof PrivateResponse) {
PrivateResponse m = (PrivateResponse) h;
item = ConversationItem
.from(ConversationActivity.this, contactName, m);
} else {
throw new AssertionError("Unknown PrivateMessageHeader");
}
addConversationItem(item);
}
private void markMessages(Collection<MessageId> messageIds, boolean sent,
......
......@@ -84,8 +84,7 @@ class ForumControllerImpl extends
} else if (e instanceof ForumInvitationResponseReceivedEvent) {
ForumInvitationResponseReceivedEvent f =
(ForumInvitationResponseReceivedEvent) e;
ForumInvitationResponse r =
(ForumInvitationResponse) f.getResponse();
ForumInvitationResponse r = f.getMessageHeader();
if (r.getObject().getId().equals(getGroupId()) && r.wasAccepted()) {
LOG.info("Forum invitation was accepted");
onForumInvitationAccepted(f.getContactId());
......
......@@ -99,8 +99,7 @@ class GroupControllerImpl extends
} else if (e instanceof GroupInvitationResponseReceivedEvent) {
GroupInvitationResponseReceivedEvent g =
(GroupInvitationResponseReceivedEvent) e;
GroupInvitationResponse r =
(GroupInvitationResponse) g.getResponse();
GroupInvitationResponse r = g.getMessageHeader();
if (getGroupId().equals(r.getObject().getId()) && r.wasAccepted()) {
listener.runOnUiThreadUnlessDestroyed(
() -> listener.onInvitationAccepted(g.getContactId()));
......
......@@ -4,18 +4,18 @@ import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.blog.Blog;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class BlogInvitationRequestReceivedEvent extends
InvitationRequestReceivedEvent<Blog> {
PrivateMessageReceivedEvent<PrivateRequest<Blog>> {
public BlogInvitationRequestReceivedEvent(Blog blog, ContactId contactId,
PrivateRequest<Blog> request) {
super(blog, contactId, request);
public BlogInvitationRequestReceivedEvent(PrivateRequest<Blog> request,
ContactId contactId) {
super(request, contactId);
}
}
......@@ -2,20 +2,19 @@ package org.briarproject.briar.api.blog.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.blog.Blog;
import org.briarproject.briar.api.blog.BlogInvitationResponse;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class BlogInvitationResponseReceivedEvent
extends InvitationResponseReceivedEvent<Blog> {
extends PrivateMessageReceivedEvent<BlogInvitationResponse> {
public BlogInvitationResponseReceivedEvent(ContactId contactId,
BlogInvitationResponse response) {
super(contactId, response);
public BlogInvitationResponseReceivedEvent(BlogInvitationResponse response,
ContactId contactId) {
super(response, contactId);
}
}
......@@ -4,18 +4,18 @@ import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.forum.Forum;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class ForumInvitationRequestReceivedEvent extends
InvitationRequestReceivedEvent<Forum> {
PrivateMessageReceivedEvent<PrivateRequest<Forum>> {
public ForumInvitationRequestReceivedEvent(Forum forum, ContactId contactId,
PrivateRequest<Forum> request) {
super(forum, contactId, request);
public ForumInvitationRequestReceivedEvent(PrivateRequest<Forum> request,
ContactId contactId) {
super(request, contactId);
}
}
......@@ -3,18 +3,18 @@ package org.briarproject.briar.api.forum.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.forum.ForumInvitationResponse;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class ForumInvitationResponseReceivedEvent extends
InvitationResponseReceivedEvent {
PrivateMessageReceivedEvent<ForumInvitationResponse> {
public ForumInvitationResponseReceivedEvent(ContactId contactId,
ForumInvitationResponse response) {
super(contactId, response);
public ForumInvitationResponseReceivedEvent(
ForumInvitationResponse response, ContactId contactId) {
super(response, contactId);
}
}
package org.briarproject.briar.api.introduction.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.introduction.IntroductionRequest;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class IntroductionRequestReceivedEvent extends Event {
public class IntroductionRequestReceivedEvent extends
PrivateMessageReceivedEvent<IntroductionRequest> {
private final ContactId contactId;
private final IntroductionRequest introductionRequest;
public IntroductionRequestReceivedEvent(ContactId contactId,
IntroductionRequest introductionRequest) {
this.contactId = contactId;
this.introductionRequest = introductionRequest;
}
public ContactId getContactId() {
return contactId;
}
public IntroductionRequest getIntroductionRequest() {
return introductionRequest;
public IntroductionRequestReceivedEvent(
IntroductionRequest introductionRequest, ContactId contactId) {
super(introductionRequest, contactId);
}
}
package org.briarproject.briar.api.introduction.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class IntroductionResponseReceivedEvent extends Event {
public class IntroductionResponseReceivedEvent extends
PrivateMessageReceivedEvent<IntroductionResponse> {
private final ContactId contactId;
private final IntroductionResponse introductionResponse;
public IntroductionResponseReceivedEvent(ContactId contactId,
IntroductionResponse introductionResponse) {
this.contactId = contactId;
this.introductionResponse = introductionResponse;
public IntroductionResponseReceivedEvent(
IntroductionResponse introductionResponse, ContactId contactId) {
super(introductionResponse, contactId);
}
public ContactId getContactId() {
return contactId;
}
public IntroductionResponse getIntroductionResponse() {
return introductionResponse;
}
}
......@@ -3,7 +3,6 @@ package org.briarproject.briar.api.messaging.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import javax.annotation.concurrent.Immutable;
......@@ -13,28 +12,22 @@ import javax.annotation.concurrent.Immutable;
*/
@Immutable
@NotNullByDefault
public class PrivateMessageReceivedEvent extends Event {
public class PrivateMessageReceivedEvent<H extends PrivateMessageHeader>
extends Event {
private final PrivateMessageHeader messageHeader;
private final H messageHeader;
private final ContactId contactId;
private final GroupId groupId;
public PrivateMessageReceivedEvent(PrivateMessageHeader messageHeader,
ContactId contactId, GroupId groupId) {
public PrivateMessageReceivedEvent(H messageHeader, ContactId contactId) {
this.messageHeader = messageHeader;
this.contactId = contactId;
this.groupId = groupId;
}
public PrivateMessageHeader getMessageHeader() {
public H getMessageHeader() {
return messageHeader;
}
public ContactId getContactId() {
return contactId;
}
public GroupId getGroupId() {
return groupId;
}
}
......@@ -2,20 +2,19 @@ package org.briarproject.briar.api.privategroup.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.privategroup.PrivateGroup;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationRequest;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class GroupInvitationRequestReceivedEvent extends
InvitationRequestReceivedEvent<PrivateGroup> {
PrivateMessageReceivedEvent<GroupInvitationRequest> {
public GroupInvitationRequestReceivedEvent(PrivateGroup group,
ContactId contactId, GroupInvitationRequest request) {
super(group, contactId, request);
public GroupInvitationRequestReceivedEvent(GroupInvitationRequest request,
ContactId contactId) {
super(request, contactId);
}
}
......@@ -2,19 +2,18 @@ package org.briarproject.briar.api.privategroup.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.privategroup.PrivateGroup;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationResponse;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class GroupInvitationResponseReceivedEvent
extends InvitationResponseReceivedEvent<PrivateGroup> {
extends PrivateMessageReceivedEvent<GroupInvitationResponse> {
public GroupInvitationResponseReceivedEvent(ContactId contactId,
PrivateResponse<PrivateGroup> response) {
super(contactId, response);
public GroupInvitationResponseReceivedEvent(
GroupInvitationResponse response, ContactId contactId) {
super(response, contactId);
}
}
package org.briarproject.briar.api.sharing.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.sharing.Shareable;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public abstract class InvitationRequestReceivedEvent<S extends Shareable>
extends Event {
private final S shareable;
private final ContactId contactId;
private final PrivateRequest<S> request;
protected InvitationRequestReceivedEvent(S shareable, ContactId contactId,
PrivateRequest<S> request) {
this.shareable = shareable;
this.contactId = contactId;
this.request = request;
}
public ContactId getContactId() {
return contactId;
}
public PrivateRequest<S> getRequest() {
return request;
}
public S getShareable() {
return shareable;
}
}
package org.briarproject.briar.api.sharing.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.sharing.Shareable;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public abstract class InvitationResponseReceivedEvent<S extends Shareable>
extends Event {
private final ContactId contactId;
private final PrivateResponse<S> response;
public InvitationResponseReceivedEvent(ContactId contactId,
PrivateResponse<S> response) {
this.contactId = contactId;
this.response = response;
}
public ContactId getContactId() {
return contactId;
}
public PrivateResponse<S> getResponse() {
return response;
}
}
......@@ -157,7 +157,7 @@ abstract class AbstractProtocolEngine<S extends Session>
s.getSessionId(), introduction,
m instanceof AcceptMessage);
IntroductionResponseReceivedEvent e =
new IntroductionResponseReceivedEvent(c.getId(), response);
new IntroductionResponseReceivedEvent(response, c.getId());
txn.attach(e);
}
......
......@@ -262,7 +262,7 @@ class IntroduceeProtocolEngine
s.getSessionId(), introduction, m.getMessage(), false,
contactExists);
IntroductionRequestReceivedEvent e =
new IntroductionRequestReceivedEvent(c.getId(), request);
new IntroductionRequestReceivedEvent(request, c.getId());
txn.attach(e);
// Move to the AWAIT_RESPONSES state
......
......@@ -116,8 +116,8 @@ class MessagingManagerImpl extends ConversationClientImpl
PrivateMessageHeader header = new PrivateMessageHeader(
m.getId(), groupId, timestamp, local, read, false, false);
ContactId contactId = getContactId(txn, groupId);
PrivateMessageReceivedEvent event = new PrivateMessageReceivedEvent(
header, contactId, groupId);
PrivateMessageReceivedEvent<PrivateMessageHeader> event =
new PrivateMessageReceivedEvent<>(header, contactId);
txn.attach(event);
messageTracker.trackIncomingMessage(txn, m);
......
......@@ -69,8 +69,7 @@ class CreatorProtocolEngine extends AbstractProtocolEngine<CreatorSession> {
}
@Override
public CreatorSession onJoinAction(Transaction txn, CreatorSession s)
throws DbException {
public CreatorSession onJoinAction(Transaction txn, CreatorSession s) {
throw new UnsupportedOperationException(); // Invalid in this role
}
......@@ -92,8 +91,8 @@ class CreatorProtocolEngine extends AbstractProtocolEngine<CreatorSession> {
}
@Override