mirror of
https://github.com/oxen-io/session-android.git
synced 2025-02-20 07:18:25 +00:00
Fix display of secure session reset records
Fixes #5605 Closes #5680 // FREEBIE
This commit is contained in:
parent
224ef9785e
commit
e1b24ab878
@ -538,7 +538,8 @@
|
|||||||
</string>
|
</string>
|
||||||
<string name="SmsMessageRecord_received_message_with_unknown_identity_key_tap_to_process">Received message with unknown identity key. Tap to process and display.</string>
|
<string name="SmsMessageRecord_received_message_with_unknown_identity_key_tap_to_process">Received message with unknown identity key. Tap to process and display.</string>
|
||||||
<string name="SmsMessageRecord_received_updated_but_unknown_identity_information">Received updated but unknown identity information. Tap to validate identity.</string>
|
<string name="SmsMessageRecord_received_updated_but_unknown_identity_information">Received updated but unknown identity information. Tap to validate identity.</string>
|
||||||
<string name="SmsMessageRecord_secure_session_reset">Secure session reset.</string>
|
<string name="SmsMessageRecord_secure_session_reset">You reset the secure session.</string>
|
||||||
|
<string name="SmsMessageRecord_secure_session_reset_s">%s reset the secure session.</string>
|
||||||
<string name="SmsMessageRecord_duplicate_message">Duplicate message.</string>
|
<string name="SmsMessageRecord_duplicate_message">Duplicate message.</string>
|
||||||
|
|
||||||
<!-- ThreadRecord -->
|
<!-- ThreadRecord -->
|
||||||
|
@ -195,7 +195,9 @@ public class ConversationAdapter <V extends View & BindableConversationItem>
|
|||||||
String type = cursor.getString(cursor.getColumnIndexOrThrow(MmsSmsDatabase.TRANSPORT));
|
String type = cursor.getString(cursor.getColumnIndexOrThrow(MmsSmsDatabase.TRANSPORT));
|
||||||
MessageRecord messageRecord = getMessageRecord(id, cursor, type);
|
MessageRecord messageRecord = getMessageRecord(id, cursor, type);
|
||||||
|
|
||||||
if (messageRecord.isGroupAction() || messageRecord.isCallLog() || messageRecord.isJoined() || messageRecord.isExpirationTimerUpdate()) {
|
if (messageRecord.isGroupAction() || messageRecord.isCallLog() || messageRecord.isJoined() ||
|
||||||
|
messageRecord.isExpirationTimerUpdate() || messageRecord.isEndSession())
|
||||||
|
{
|
||||||
return MESSAGE_TYPE_UPDATE;
|
return MESSAGE_TYPE_UPDATE;
|
||||||
} else if (messageRecord.isOutgoing()) {
|
} else if (messageRecord.isOutgoing()) {
|
||||||
return MESSAGE_TYPE_OUTGOING;
|
return MESSAGE_TYPE_OUTGOING;
|
||||||
|
@ -180,7 +180,8 @@ public class ConversationFragment extends Fragment
|
|||||||
|
|
||||||
for (MessageRecord messageRecord : messageRecords) {
|
for (MessageRecord messageRecord : messageRecords) {
|
||||||
if (messageRecord.isGroupAction() || messageRecord.isCallLog() ||
|
if (messageRecord.isGroupAction() || messageRecord.isCallLog() ||
|
||||||
messageRecord.isJoined() || messageRecord.isExpirationTimerUpdate())
|
messageRecord.isJoined() || messageRecord.isExpirationTimerUpdate() ||
|
||||||
|
messageRecord.isEndSession())
|
||||||
{
|
{
|
||||||
actionMessage = true;
|
actionMessage = true;
|
||||||
break;
|
break;
|
||||||
|
@ -86,6 +86,7 @@ public class ConversationUpdateItem extends LinearLayout
|
|||||||
else if (messageRecord.isCallLog()) setCallRecord(messageRecord);
|
else if (messageRecord.isCallLog()) setCallRecord(messageRecord);
|
||||||
else if (messageRecord.isJoined()) setJoinedRecord(messageRecord);
|
else if (messageRecord.isJoined()) setJoinedRecord(messageRecord);
|
||||||
else if (messageRecord.isExpirationTimerUpdate()) setTimerRecord(messageRecord);
|
else if (messageRecord.isExpirationTimerUpdate()) setTimerRecord(messageRecord);
|
||||||
|
else if (messageRecord.isEndSession()) setEndSessionRecord(messageRecord);
|
||||||
else throw new AssertionError("Neither group nor log nor joined.");
|
else throw new AssertionError("Neither group nor log nor joined.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,6 +130,13 @@ public class ConversationUpdateItem extends LinearLayout
|
|||||||
date.setVisibility(View.GONE);
|
date.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setEndSessionRecord(MessageRecord messageRecord) {
|
||||||
|
icon.setImageResource(R.drawable.ic_refresh_white_24dp);
|
||||||
|
icon.setColorFilter(new PorterDuffColorFilter(Color.parseColor("#757575"), PorterDuff.Mode.MULTIPLY));
|
||||||
|
body.setText(messageRecord.getDisplayBody());
|
||||||
|
date.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onModified(Recipients recipients) {
|
public void onModified(Recipients recipients) {
|
||||||
onModified(recipients.getPrimaryRecipient());
|
onModified(recipients.getPrimaryRecipient());
|
||||||
|
@ -90,8 +90,10 @@ public class SmsMessageRecord extends MessageRecord {
|
|||||||
return emphasisAdded(context.getString(R.string.MessageDisplayHelper_message_encrypted_for_non_existing_session));
|
return emphasisAdded(context.getString(R.string.MessageDisplayHelper_message_encrypted_for_non_existing_session));
|
||||||
} else if (!getBody().isPlaintext()) {
|
} else if (!getBody().isPlaintext()) {
|
||||||
return emphasisAdded(context.getString(R.string.MessageNotifier_locked_message));
|
return emphasisAdded(context.getString(R.string.MessageNotifier_locked_message));
|
||||||
} else if (SmsDatabase.Types.isEndSessionType(type)) {
|
} else if (isEndSession() && isOutgoing()) {
|
||||||
return emphasisAdded(context.getString(R.string.SmsMessageRecord_secure_session_reset));
|
return emphasisAdded(context.getString(R.string.SmsMessageRecord_secure_session_reset));
|
||||||
|
} else if (isEndSession()) {
|
||||||
|
return emphasisAdded(context.getString(R.string.SmsMessageRecord_secure_session_reset_s, getIndividualRecipient().toShortString()));
|
||||||
} else {
|
} else {
|
||||||
return super.getDisplayBody();
|
return super.getDisplayBody();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user