mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-19 06:09:55 +01:00
Fix header problem with revoke remote wipe messages
This commit is contained in:
@@ -334,23 +334,19 @@ class ConversationVisitor implements
|
|||||||
return new ConversationNoticeItem(
|
return new ConversationNoticeItem(
|
||||||
R.layout.list_item_conversation_notice_out, text, r);
|
R.layout.list_item_conversation_notice_out, text, r);
|
||||||
default: // REVOKE
|
default: // REVOKE
|
||||||
|
String revokeText;
|
||||||
if (r.isLocal()) {
|
if (r.isLocal()) {
|
||||||
String revokeText =
|
revokeText = ctx.getString(R.string.remote_wipe_revoke_sent,
|
||||||
ctx.getString(R.string.remote_wipe_revoke_sent,
|
contactName.getValue());
|
||||||
contactName.getValue()) + " " + UiUtils
|
|
||||||
.formatDateAbsolute(ctx,
|
|
||||||
r.getMessageExpiry());
|
|
||||||
return new ConversationNoticeItem(
|
return new ConversationNoticeItem(
|
||||||
R.layout.list_item_conversation_notice_out,
|
R.layout.list_item_conversation_notice_out,
|
||||||
revokeText, r);
|
revokeText, r);
|
||||||
} else {
|
} else {
|
||||||
String revokeText =
|
revokeText =
|
||||||
ctx.getString(R.string.remote_wipe_revoke_received,
|
ctx.getString(R.string.remote_wipe_revoke_received,
|
||||||
contactName.getValue()) + " " + UiUtils
|
contactName.getValue());
|
||||||
.formatDateAbsolute(ctx,
|
|
||||||
r.getMessageExpiry());
|
|
||||||
return new ConversationNoticeItem(
|
return new ConversationNoticeItem(
|
||||||
R.layout.list_item_conversation_notice_out,
|
R.layout.list_item_conversation_notice_in,
|
||||||
revokeText, r);
|
revokeText, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -750,7 +750,7 @@
|
|||||||
<string name="activity_name_remote_wipe">Remote Wipe</string>
|
<string name="activity_name_remote_wipe">Remote Wipe</string>
|
||||||
<string name="assigned_wipers">Your assigned trusted wipers</string>
|
<string name="assigned_wipers">Your assigned trusted wipers</string>
|
||||||
<string name="activate_remote_wipe">Activate remote wipe</string>
|
<string name="activate_remote_wipe">Activate remote wipe</string>
|
||||||
<string name="remote_wipe_revoke_sent">%1$s may no longer activate a remote wipe.</string>
|
<string name="remote_wipe_revoke_sent">You have removed %1$s as a remote wiper.</string>
|
||||||
<string name="remote_wipe_revoke_received">You can no longer activate a remote wipe for %1$s.</string>
|
<string name="remote_wipe_revoke_received">You can no longer activate a remote wipe for %1$s.</string>
|
||||||
|
|
||||||
<!-- activate -->
|
<!-- activate -->
|
||||||
|
|||||||
@@ -7,4 +7,6 @@ public interface MessageParser {
|
|||||||
void parseSetupMessage(BdfList body) throws FormatException;
|
void parseSetupMessage(BdfList body) throws FormatException;
|
||||||
|
|
||||||
void parseWipeMessage(BdfList body) throws FormatException;
|
void parseWipeMessage(BdfList body) throws FormatException;
|
||||||
|
|
||||||
|
void parseRevokeMessage(BdfList body) throws FormatException;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,4 +21,9 @@ public class MessageParserImpl implements MessageParser {
|
|||||||
public void parseWipeMessage(BdfList body) throws FormatException {
|
public void parseWipeMessage(BdfList body) throws FormatException {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void parseRevokeMessage(BdfList body) throws FormatException {
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -411,6 +411,14 @@ public class RemoteWipeManagerImpl extends ConversationClientImpl
|
|||||||
createMessageHeader(message, meta, status,
|
createMessageHeader(message, meta, status,
|
||||||
WIPE));
|
WIPE));
|
||||||
}
|
}
|
||||||
|
} else if (meta.getLong(MSG_KEY_MESSAGE_TYPE).intValue() ==
|
||||||
|
REVOKE.getValue()) {
|
||||||
|
Message message = clientHelper
|
||||||
|
.getMessage(txn, messageEntry.getKey());
|
||||||
|
MessageStatus status = db.getMessageStatus(txn, contactId,
|
||||||
|
messageEntry.getKey());
|
||||||
|
headers.add(
|
||||||
|
createMessageHeader(message, meta, status, REVOKE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return headers;
|
return headers;
|
||||||
|
|||||||
Reference in New Issue
Block a user