mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 02:39:05 +01:00
Display message when getting or sending a remote wipe setup message
This commit is contained in:
@@ -3,6 +3,7 @@ package org.briarproject.briar.android.conversation;
|
||||
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.briar.api.conversation.ConversationRequest;
|
||||
import org.briarproject.briar.api.conversation.ConversationResponse;
|
||||
import org.briarproject.briar.api.remotewipe.RemoteWipeMessageHeader;
|
||||
import org.briarproject.briar.api.socialbackup.ShardMessageHeader;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
@@ -38,6 +39,13 @@ class ConversationNoticeItem extends ConversationItem {
|
||||
this.msgText = null;
|
||||
}
|
||||
|
||||
ConversationNoticeItem(@LayoutRes int layoutRes, String text,
|
||||
RemoteWipeMessageHeader r) {
|
||||
super(layoutRes, r);
|
||||
this.text = text;
|
||||
this.msgText = null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
String getMsgText() {
|
||||
return msgText;
|
||||
|
||||
@@ -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.RemoteWipeMessageHeader;
|
||||
import org.briarproject.briar.api.socialbackup.ShardMessageHeader;
|
||||
|
||||
import java.util.List;
|
||||
@@ -306,6 +307,19 @@ class ConversationVisitor implements
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ConversationItem visitRemoteWipeMessage(RemoteWipeMessageHeader r) {
|
||||
if (r.isLocal()) {
|
||||
String text = ctx.getString(R.string.remote_wipe_setup_sent);
|
||||
return new ConversationNoticeItem(
|
||||
R.layout.list_item_conversation_notice_out, text, r);
|
||||
} else {
|
||||
String text = ctx.getString(R.string.remote_wipe_setup_received);
|
||||
return new ConversationNoticeItem(
|
||||
R.layout.list_item_conversation_notice_in, text, r);
|
||||
}
|
||||
}
|
||||
|
||||
interface TextCache {
|
||||
@Nullable
|
||||
String getText(MessageId m);
|
||||
|
||||
@@ -729,4 +729,11 @@
|
||||
<string name="activity_name_new_or_recover_account">Create new account or recover existing account</string>
|
||||
<string name="activity_name_recovery">Recover Account</string>
|
||||
<string name="activity_name_custodian_help_recovery">Help recover account</string>
|
||||
|
||||
<!-- Remote Wipe -->
|
||||
|
||||
<!-- conversation -->
|
||||
<string name="remote_wipe_setup_received">You have been added a remote wiper.</string>
|
||||
<string name="remote_wipe_setup_sent">You have added this contact as a remote wiper.</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user