Commit 92d31aa1 authored by ameba23's avatar ameba23

Add an event for received setup messages

parent 71c502df
Pipeline #6692 failed with stages
in 8 minutes and 24 seconds
......@@ -31,6 +31,8 @@ import org.briarproject.briar.api.remotewipe.MessageEncoder;
import org.briarproject.briar.api.remotewipe.MessageParser;
import org.briarproject.briar.api.remotewipe.RemoteWipeManager;
import org.briarproject.briar.api.remotewipe.RemoteWipeMessageHeader;
import org.briarproject.briar.api.remotewipe.RemoteWipeReceivedEvent;
import org.briarproject.briar.api.socialbackup.ShardReceivedEvent;
import org.briarproject.briar.client.ConversationClientImpl;
import java.util.ArrayList;
......@@ -122,8 +124,12 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl
MessageType type = MessageType.fromValue(body.getLong(0).intValue());
if (type == SETUP) {
messageTracker.trackIncomingMessage(txn, m);
// message.getGroupId turn into contactid
// txn.attach event
ContactId contactId = getContactId(txn, m.getGroupId());
MessageStatus status = db.getMessageStatus(txn, contactId,
m.getId());
txn.attach(new RemoteWipeReceivedEvent(
createMessageHeader(m, meta, status), contactId));
} else if (type == WIPE) {
if (!remoteWipeIsSetup(txn)) return false;
if (clock.currentTimeMillis() - m.getTimestamp() > MAX_MESSAGE_AGE)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment