mirror of
https://github.com/deltachat/deltachat-android.git
synced 2025-10-05 19:41:57 +02:00
allow tapping new e2ee-info-messages; remove outdated protection-broken path
This commit is contained in:
parent
9740921f25
commit
9e87a4b2a8
9 changed files with 6 additions and 46 deletions
|
@ -1272,11 +1272,6 @@ JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isProtected(JNIEnv *env, jobje
|
||||||
return dc_chat_is_protected(get_dc_chat(env, obj))!=0;
|
return dc_chat_is_protected(get_dc_chat(env, obj))!=0;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isProtectionBroken(JNIEnv *env, jobject obj)
|
|
||||||
{
|
|
||||||
return dc_chat_is_protection_broken(get_dc_chat(env, obj))!=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isSendingLocations(JNIEnv *env, jobject obj)
|
JNIEXPORT jboolean Java_com_b44t_messenger_DcChat_isSendingLocations(JNIEnv *env, jobject obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,7 +45,6 @@ public class DcChat {
|
||||||
public native boolean isDeviceTalk ();
|
public native boolean isDeviceTalk ();
|
||||||
public native boolean canSend ();
|
public native boolean canSend ();
|
||||||
public native boolean isProtected ();
|
public native boolean isProtected ();
|
||||||
public native boolean isProtectionBroken();
|
|
||||||
public native boolean isSendingLocations();
|
public native boolean isSendingLocations();
|
||||||
public native boolean isMuted ();
|
public native boolean isMuted ();
|
||||||
public native boolean isContactRequest ();
|
public native boolean isContactRequest ();
|
||||||
|
@ -70,7 +69,7 @@ public class DcChat {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHalfBlocked() {
|
public boolean isHalfBlocked() {
|
||||||
return isProtectionBroken() || isContactRequest();
|
return isContactRequest();
|
||||||
}
|
}
|
||||||
|
|
||||||
// working with raw c-data
|
// working with raw c-data
|
||||||
|
|
|
@ -33,9 +33,9 @@ public class DcMsg {
|
||||||
public final static int DC_INFO_LOCATION_ONLY = 9;
|
public final static int DC_INFO_LOCATION_ONLY = 9;
|
||||||
public final static int DC_INFO_EPHEMERAL_TIMER_CHANGED = 10;
|
public final static int DC_INFO_EPHEMERAL_TIMER_CHANGED = 10;
|
||||||
public final static int DC_INFO_PROTECTION_ENABLED = 11;
|
public final static int DC_INFO_PROTECTION_ENABLED = 11;
|
||||||
public final static int DC_INFO_PROTECTION_DISABLED = 12;
|
|
||||||
public final static int DC_INFO_INVALID_UNENCRYPTED_MAIL = 13;
|
public final static int DC_INFO_INVALID_UNENCRYPTED_MAIL = 13;
|
||||||
public final static int DC_INFO_WEBXDC_INFO_MESSAGE = 32;
|
public final static int DC_INFO_WEBXDC_INFO_MESSAGE = 32;
|
||||||
|
public final static int DC_INFO_CHAT_E2EE = 50;
|
||||||
|
|
||||||
public final static int DC_STATE_UNDEFINED = 0;
|
public final static int DC_STATE_UNDEFINED = 0;
|
||||||
public final static int DC_STATE_IN_FRESH = 10;
|
public final static int DC_STATE_IN_FRESH = 10;
|
||||||
|
|
|
@ -81,7 +81,7 @@ public abstract class BaseConversationItem extends LinearLayout
|
||||||
protected boolean shouldInterceptClicks(DcMsg messageRecord) {
|
protected boolean shouldInterceptClicks(DcMsg messageRecord) {
|
||||||
return batchSelected.isEmpty()
|
return batchSelected.isEmpty()
|
||||||
&& (messageRecord.isFailed()
|
&& (messageRecord.isFailed()
|
||||||
|| messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_DISABLED
|
|| messageRecord.getInfoType() == DcMsg.DC_INFO_CHAT_E2EE
|
||||||
|| messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED
|
|| messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED
|
||||||
|| messageRecord.getInfoType() == DcMsg.DC_INFO_INVALID_UNENCRYPTED_MAIL);
|
|| messageRecord.getInfoType() == DcMsg.DC_INFO_INVALID_UNENCRYPTED_MAIL);
|
||||||
}
|
}
|
||||||
|
@ -129,9 +129,7 @@ public abstract class BaseConversationItem extends LinearLayout
|
||||||
.setPositiveButton(R.string.ok, null)
|
.setPositiveButton(R.string.ok, null)
|
||||||
.create();
|
.create();
|
||||||
d.show();
|
d.show();
|
||||||
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_DISABLED) {
|
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_CHAT_E2EE || messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED) {
|
||||||
DcHelper.showVerificationBrokenDialog(context, conversationRecipient.getName());
|
|
||||||
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED) {
|
|
||||||
DcHelper.showProtectionEnabledDialog(context);
|
DcHelper.showProtectionEnabledDialog(context);
|
||||||
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_INVALID_UNENCRYPTED_MAIL) {
|
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_INVALID_UNENCRYPTED_MAIL) {
|
||||||
DcHelper.showInvalidUnencryptedDialog(context);
|
DcHelper.showInvalidUnencryptedDialog(context);
|
||||||
|
|
|
@ -1623,15 +1623,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if (dcChat.isProtectionBroken()) {
|
if (dcChat.getType() == DcChat.DC_CHAT_TYPE_GROUP) {
|
||||||
messageRequestBottomView.setBlockText(R.string.more_info_desktop);
|
|
||||||
String name = dcContext.getContact(recipient.getDcContact().getId()).getDisplayName();
|
|
||||||
messageRequestBottomView.setBlockOnClickListener(v -> DcHelper.showVerificationBrokenDialog(this, name));
|
|
||||||
|
|
||||||
messageRequestBottomView.setQuestion(getString(R.string.chat_protection_broken, name));
|
|
||||||
messageRequestBottomView.setAcceptText(R.string.ok);
|
|
||||||
|
|
||||||
} else if (dcChat.getType() == DcChat.DC_CHAT_TYPE_GROUP) {
|
|
||||||
// We don't support blocking groups yet, so offer to delete it instead
|
// We don't support blocking groups yet, so offer to delete it instead
|
||||||
messageRequestBottomView.setBlockText(R.string.delete);
|
messageRequestBottomView.setBlockText(R.string.delete);
|
||||||
messageRequestBottomView.setBlockOnClickListener(v -> handleDeleteChat());
|
messageRequestBottomView.setBlockOnClickListener(v -> handleDeleteChat());
|
||||||
|
|
|
@ -116,9 +116,6 @@ public class ConversationUpdateItem extends BaseConversationItem
|
||||||
if (infoType == DcMsg.DC_INFO_PROTECTION_ENABLED) {
|
if (infoType == DcMsg.DC_INFO_PROTECTION_ENABLED) {
|
||||||
verifiedIcon.setVisibility(VISIBLE);
|
verifiedIcon.setVisibility(VISIBLE);
|
||||||
verifiedIcon.setImageResource(R.drawable.ic_verified);
|
verifiedIcon.setImageResource(R.drawable.ic_verified);
|
||||||
} else if (infoType == DcMsg.DC_INFO_PROTECTION_DISABLED) {
|
|
||||||
verifiedIcon.setVisibility(VISIBLE);
|
|
||||||
verifiedIcon.setImageResource(R.drawable.ic_verified_broken);
|
|
||||||
} else {
|
} else {
|
||||||
verifiedIcon.setVisibility(GONE);
|
verifiedIcon.setVisibility(GONE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -464,16 +464,6 @@ public class DcHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void showVerificationBrokenDialog(Context context, String name) {
|
|
||||||
new AlertDialog.Builder(context)
|
|
||||||
.setMessage(context.getString(R.string.chat_protection_broken_explanation, name))
|
|
||||||
.setNeutralButton(R.string.learn_more, (d, w) -> openHelp(context, "#nocryptanymore"))
|
|
||||||
.setNegativeButton(R.string.qrscan_title, (d, w) -> context.startActivity(new Intent(context, QrActivity.class)))
|
|
||||||
.setPositiveButton(R.string.ok, null)
|
|
||||||
.setCancelable(true)
|
|
||||||
.show();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void showProtectionEnabledDialog(Context context) {
|
public static void showProtectionEnabledDialog(Context context) {
|
||||||
new AlertDialog.Builder(context)
|
new AlertDialog.Builder(context)
|
||||||
.setMessage(context.getString(R.string.chat_protection_enabled_explanation))
|
.setMessage(context.getString(R.string.chat_protection_enabled_explanation))
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
<vector android:height="18sp" android:viewportHeight="1304.4"
|
|
||||||
android:viewportWidth="1325.6" android:width="18sp" xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<path android:fillColor="#ffffff"
|
|
||||||
android:pathData="M259.8,272.4L1072.6,272.4A0,0 0,0 1,1072.7 272.4L1072.7,1032.2A0,0 0,0 1,1072.6 1032.3L259.8,1032.3A0,0 0,0 1,259.7 1032.2L259.7,272.4A0,0 0,0 1,259.8 272.4z" android:strokeWidth="178.139"/>
|
|
||||||
<path android:fillColor="#b9b9b9"
|
|
||||||
android:pathData="M643.6,1303C555.7,1295.1 479.5,1229.9 452.5,1146.8 365.5,1173.3 257.1,1169.4 192.1,1098 135.6,1041.4 126.1,954.9 133.2,879.5 28,840.4 -23.6,710.9 10.9,606.9 31.5,539.3 89.5,491.4 151,461.3 132.5,383.7 109.5,287.3 176.8,208.6 245.9,117.6 351.5,123.1 457,148.5 487.4,54.1 587.2,-8.2 685.1,1.1 768.6,4.6 848,60.7 874.9,140.6c74.6,-12.9 160.9,-20.5 223.1,31.8 50.7,39.9 88.8,99.2 87.8,165.5 0.9,40.1 -11.3,80.4 -17.3,118.5 91,17 150.8,110.4 156,198.8 -1.4,112 -39.9,161.5 -142.2,226.4 -23.1,9.2 -7.6,-23.6 0.1,0.2 15,101.5 -12.8,196.7 -94.3,247 -61.8,38 -138.4,38.2 -207.8,25.9 -31.3,91.2 -125,155 -221.5,149.4 -5.1,0.5 -10.1,-0.7 -15.1,-1.1zM1035.6,509.5 L915.2,385.5 612.9,685.4 411,498.7 289.1,614.8 603.1,931.9Z" android:strokeWidth="1.33333"/>
|
|
||||||
<path android:fillColor="#00000000"
|
|
||||||
android:pathData="M64.6,1240 L1265.3,65.5"
|
|
||||||
android:strokeColor="#ff0c16" android:strokeLineCap="butt"
|
|
||||||
android:strokeLineJoin="miter" android:strokeWidth="178.139"/>
|
|
||||||
</vector>
|
|
|
@ -972,7 +972,7 @@
|
||||||
<string name="ephemeral_timer_weeks_by_you">You set disappearing messages timer to %1$s weeks.</string>
|
<string name="ephemeral_timer_weeks_by_you">You set disappearing messages timer to %1$s weeks.</string>
|
||||||
<!-- %1$s will be replaced by the number of weeks (always >1) the timer is set to, %2$s will be replaced by name and address of the contact -->
|
<!-- %1$s will be replaced by the number of weeks (always >1) the timer is set to, %2$s will be replaced by name and address of the contact -->
|
||||||
<string name="ephemeral_timer_weeks_by_other">Disappearing messages timer set to %1$s weeks by %2$s.</string>
|
<string name="ephemeral_timer_weeks_by_other">Disappearing messages timer set to %1$s weeks by %2$s.</string>
|
||||||
<!-- this may be shown instead of the chat's input field, with buttons "More Info" and "OK" -->
|
<!-- deprecated -->
|
||||||
<string name="chat_protection_broken">%1$s sent a message from another device.</string>
|
<string name="chat_protection_broken">%1$s sent a message from another device.</string>
|
||||||
<string name="chat_protection_enabled_tap_to_learn_more">Messages are end-to-end encrypted. Tap to learn more.</string>
|
<string name="chat_protection_enabled_tap_to_learn_more">Messages are end-to-end encrypted. Tap to learn more.</string>
|
||||||
<string name="chat_protection_enabled_explanation">All messages in this chat are end-to-end encrypted.\n\nEnd-to-end encryption keeps messages private between you and your chat partners. Not even servers, providers or relays can read them.</string>
|
<string name="chat_protection_enabled_explanation">All messages in this chat are end-to-end encrypted.\n\nEnd-to-end encryption keeps messages private between you and your chat partners. Not even servers, providers or relays can read them.</string>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue