Display message when getting or sending a remote wipe wipe message

This commit is contained in:
ameba23
2021-05-25 12:55:46 +02:00
parent d42c25ebf7
commit a8bef40fee
2 changed files with 24 additions and 8 deletions

View File

@@ -16,6 +16,7 @@ import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationRequest;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationResponse;
import org.briarproject.briar.api.remotewipe.MessageType;
import org.briarproject.briar.api.remotewipe.RemoteWipeMessageHeader;
import org.briarproject.briar.api.socialbackup.ShardMessageHeader;
@@ -309,14 +310,28 @@ class ConversationVisitor implements
@Override
public ConversationItem visitRemoteWipeMessage(RemoteWipeMessageHeader r) {
if (r.isLocal()) {
String text = ctx.getString(R.string.remote_wipe_setup_sent, contactName.getValue());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_out, text, r);
} else {
String text = ctx.getString(R.string.remote_wipe_setup_received, contactName.getValue());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_in, text, r);
switch (r.getMessageType()) {
case SETUP:
if (r.isLocal()) {
String text = ctx.getString(R.string.remote_wipe_setup_sent, contactName.getValue());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_out, text, r);
} else {
String text = ctx.getString(R.string.remote_wipe_setup_received, contactName.getValue());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_in, text, r);
}
default: // WIPE
if (r.isLocal()) {
String text = ctx.getString(R.string.remote_wipe_wipe_sent, contactName.getValue());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_out, text, r);
} else {
// TODO this is only for testing - will be removed in production
String text = "GOT REMOTE WIPE SIGNAL";
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_in, text, r);
}
}
}

View File

@@ -746,6 +746,7 @@
<!-- conversation -->
<string name="remote_wipe_setup_received">%1$s has added you as a remote wiper.</string>
<string name="remote_wipe_setup_sent">You have added %1$s as a remote wiper.</string>
<string name="remote_wipe_wipe_sent">You have sent an activate remote wipe signal to %1$s.</string>
<string name="activity_name_remote_wipe">Remote Wipe</string>
<string name="assigned_wipers">Your assigned trusted wipers</string>
<string name="activate_remote_wipe">Activate remote wipe</string>