Rename event, only broadcast it when adding a new contact.

This commit is contained in:
akwizgran
2022-08-16 15:06:38 +01:00
parent ab360e1e25
commit de76986ee4
4 changed files with 46 additions and 35 deletions

View File

@@ -3,27 +3,28 @@ package org.briarproject.bramble.api.mailbox.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.mailbox.MailboxUpdate;
import org.briarproject.bramble.api.mailbox.MailboxUpdateManager;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import javax.annotation.concurrent.Immutable;
/**
* An event that is broadcast when a mailbox update is sent to a contact.
* An event that is broadcast when the first mailbox update is sent to a
* newly added contact, which happens in the same transaction in which the
* contact is added.
* <p>
* Note that this event is not broadcast when a mailbox is paired or
* unpaired, although updates are sent to all contacts in those situations.
*
* @see MailboxPairedEvent
* @see MailboxUnpairedEvent
* This event is not broadcast when the first mailbox update is sent to an
* existing contact when setting up the
* {@link MailboxUpdateManager mailbox update client}.
*/
@Immutable
@NotNullByDefault
public class MailboxUpdateSentEvent extends Event {
public class MailboxUpdateSentToNewContactEvent extends Event {
private final ContactId contactId;
private final MailboxUpdate mailboxUpdate;
public MailboxUpdateSentEvent(ContactId contactId,
public MailboxUpdateSentToNewContactEvent(ContactId contactId,
MailboxUpdate mailboxUpdate) {
this.contactId = contactId;
this.mailboxUpdate = mailboxUpdate;