Display expiration date on outgoing remote wipe message notification

This commit is contained in:
ameba23
2021-06-03 09:37:15 +02:00
parent ab136d3167
commit 2177036044
5 changed files with 25 additions and 15 deletions

View File

@@ -6,6 +6,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.R;
import org.briarproject.briar.android.attachment.AttachmentItem;
import org.briarproject.briar.android.util.UiUtils;
import org.briarproject.briar.api.blog.BlogInvitationRequest;
import org.briarproject.briar.api.blog.BlogInvitationResponse;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
@@ -16,7 +17,6 @@ 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;
@@ -315,16 +315,22 @@ class ConversationVisitor implements
switch (r.getMessageType()) {
case SETUP:
if (r.isLocal()) {
String text = ctx.getString(R.string.remote_wipe_setup_sent, contactName.getValue());
String text = ctx.getString(R.string.remote_wipe_setup_sent,
contactName.getValue());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_out, text, r);
R.layout.list_item_conversation_notice_out, text,
r);
} else {
String text = ctx.getString(R.string.remote_wipe_setup_received, contactName.getValue());
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
String text = ctx.getString(R.string.remote_wipe_wipe_sent, contactName.getValue());
String text = ctx.getString(R.string.remote_wipe_wipe_sent,
contactName.getValue()) + " " + UiUtils
.formatDateAbsolute(ctx, r.getMessageExpiry());
return new ConversationNoticeItem(
R.layout.list_item_conversation_notice_out, text, r);
}

View File

@@ -747,7 +747,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="remote_wipe_wipe_sent">You have sent an activate remote wipe signal to %1$s. It expires </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>