From 8800e50b6ef8561cc0e0806f564bd3134435302c Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Wed, 1 Feb 2017 14:55:03 +0100 Subject: [PATCH] Add Display image for uncrypted message when Lime is enable --- res/drawable-xhdpi/lime_ko.png | Bin 0 -> 1015 bytes res/values/strings.xml | 1 + src/org/linphone/ChatFragment.java | 14 +++++++++++++- submodules/linphone | 2 +- 4 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 res/drawable-xhdpi/lime_ko.png diff --git a/res/drawable-xhdpi/lime_ko.png b/res/drawable-xhdpi/lime_ko.png new file mode 100644 index 0000000000000000000000000000000000000000..17dea795e8b6b9b17d03231a2f7394d94b27a873 GIT binary patch literal 1015 zcmV_;6=roDkv3N#flIGX}xg)E4>hN=dFq$f}$cwqadZNB7#ULZYi|2R)b!M zsNg~p6%$+=aQV&a#XrL7mvfr`Y+1yCfy_BG?>zr3-+bqrcqB-IKEM~iB48RY5*P!# z1nvUOz~8`84;tv|Bp4*vB6uiJf%%qTwV|^$C#cB+ z@&m!ykWTLj_6WWdR0;YC$_0}J)q1$ATI`-vTs73ii5@v^wk4 z0^JxOepN6&hSq$+Bct_7dCQRq@)N;xBitY;PoOy^z*<~OWDNudj9{x^Yznh9FJKw0 ziYrzbAXc5?+TUfg8wJI2glde?WkFGjpu+`EO&_zv>i=KIUzzeQ58BfL_22<;#612w z>aXo@rv0^GR0j6>8#AI8qY6wg0@pJ-?J7(^Em5c5j$U&{Cvz+C!dD(DD2oC*+>~3g zp!7gS+XE`1fLi05%g`aqb<%hKp>uv00+qh!(@nj}nRq+-G{}_K2p;)&rfBhHg=wRD+pM`{eHbmL=k<61|X%tw&)R6Gcrl{sAvKpXscyXS%hrrt!i z@hs%FICeCa!56FyfNc}Zaqp|l=6jpB$2It|PbL@DYd7tm304T2;zFhl>IAV!9kKpu`0w8+FM5sYv#{Gc=!n9=P{iSl2Jr+`mGstg9| z1XH>VR4@!UO-G0urd$D>6iiGyb#d%yx!^*;nmi#Wb2ldT-F?BNF567*>gId^NZs2g zhYP3g45-s67?(MyV4&b!0KjiHmhWJ92h_dOSui*esJj`d59s)JLI038p1WkQZEg!b z&IrCzF`vAnd5P&ENS_Error, image not saved Please wait... An error occurred during the file transfer + Warning, this message is not encrypted 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. Processing image, can take up to a few seconds depending on the size of the file diff --git a/src/org/linphone/ChatFragment.java b/src/org/linphone/ChatFragment.java index 08882b598..6d8ee3917 100644 --- a/src/org/linphone/ChatFragment.java +++ b/src/org/linphone/ChatFragment.java @@ -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) { diff --git a/submodules/linphone b/submodules/linphone index 9551c9118..1cf4eda4a 160000 --- a/submodules/linphone +++ b/submodules/linphone @@ -1 +1 @@ -Subproject commit 9551c9118a660453a3d01f2ffee8ae8750be66be +Subproject commit 1cf4eda4aac0fdd1fdac150f6e0592368bf93459