diff --git a/bramble-core/src/main/java/org/briarproject/bramble/mailbox/protocol/MailboxRequestTake.java b/bramble-core/src/main/java/org/briarproject/bramble/mailbox/protocol/MailboxRequestTake.java index 6fe0b80ac2664674789905b92eb02dd591c7df16..9919f0c85571e214396483d1bc44a53d8daecb88 100644 --- a/bramble-core/src/main/java/org/briarproject/bramble/mailbox/protocol/MailboxRequestTake.java +++ b/bramble-core/src/main/java/org/briarproject/bramble/mailbox/protocol/MailboxRequestTake.java @@ -5,12 +5,10 @@ import org.briarproject.bramble.api.contact.ContactId; import org.briarproject.bramble.api.data.BdfList; public class MailboxRequestTake extends MailboxRequest { - private ContactId contactId; private byte[] encryptedSyncStream = null; - public MailboxRequestTake(ContactId contactId, byte[] encryptedSyncStream) { + public MailboxRequestTake(byte[] encryptedSyncStream) { super(TYPE.TAKE); - this.contactId = contactId; this.encryptedSyncStream = encryptedSyncStream; } @@ -20,7 +18,7 @@ public class MailboxRequestTake extends MailboxRequest { @Override protected BdfList getRequestBody() { - return BdfList.of(contactId.getInt(), encryptedSyncStream); + return BdfList.of(encryptedSyncStream); } @Override @@ -30,20 +28,12 @@ public class MailboxRequestTake extends MailboxRequest { @Override public void parseBody(BdfList msg) throws FormatException { - Long cId = msg.getLong(0); - - if (cId > Integer.MAX_VALUE || cId < Integer.MIN_VALUE) - throw new FormatException(); - - this.contactId = new ContactId(cId.intValue()); - this.encryptedSyncStream = msg.getRaw(1); + this.encryptedSyncStream = msg.getRaw(0); } public byte[] getEncryptedSyncStream() { return encryptedSyncStream; } - public ContactId getContactId() { - return contactId; - } + }