Add Display image for uncrypted message when Lime is enable

This commit is contained in:
Erwan Croze 2017-02-01 14:55:03 +01:00
parent 8ee3e75bfa
commit 8800e50b6e
4 changed files with 15 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,015 B

View file

@ -187,6 +187,7 @@
<string name="image_not_saved">Error, image not saved</string>
<string name="wait">Please wait...</string>
<string name="image_transfert_error">An error occurred during the file transfer</string>
<string name="message_not_encrypted">Warning, this message is not encrypted</string>
<string name="lime_not_verified">You are trying to send a message using LIME to a contact not verified by ZRTP.\nPlease call this contact and verify his ZRTP key before sending your messages.</string>
<string name="processing_image">Processing image, can take up to a few seconds depending on the size of the file</string>

View file

@ -1135,6 +1135,15 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
}
view.setId(holder.id);
registerForContextMenu(view);
view.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (!message.isSecured() &&
LinphoneManager.getLc().getLimeEncryption() == LinphoneCore.LinphoneLimeState.Mandatory) {
LinphoneUtils.displayErrorAlert(getString(R.string.message_not_encrypted), LinphoneActivity.instance());
}
}
});
LinphoneChatMessage.State status = message.getStatus();
String externalBodyUrl = message.getExternalBodyUrl();
@ -1174,9 +1183,12 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
if (status == LinphoneChatMessage.State.NotDelivered) {
holder.messageStatus.setVisibility(View.VISIBLE);
holder.messageStatus.setImageResource(R.drawable.chat_message_not_delivered);
} else if (status == LinphoneChatMessage.State.InProgress) {
holder.messageSendingInProgress.setVisibility(View.VISIBLE);
} else if (!message.isSecured() &&
LinphoneManager.getLc().getLimeEncryption() == LinphoneCore.LinphoneLimeState.Mandatory) {
holder.messageStatus.setVisibility(View.VISIBLE);
holder.messageStatus.setImageResource(R.drawable.lime_ko);
}
if (externalBodyUrl != null || fileTransferContent != null) {

@ -1 +1 @@
Subproject commit 9551c9118a660453a3d01f2ffee8ae8750be66be
Subproject commit 1cf4eda4aac0fdd1fdac150f6e0592368bf93459