allow tapping new e2ee-info-messages; remove outdated protection-broken path

This commit is contained in:
B. Petersen
2025-07-19 12:09:34 +02:00
committed by bjoern
parent 9740921f25
commit 9e87a4b2a8
9 changed files with 6 additions and 46 deletions
+1 -2
View File
@@ -45,7 +45,6 @@ public class DcChat {
public native boolean isDeviceTalk ();
public native boolean canSend ();
public native boolean isProtected ();
public native boolean isProtectionBroken();
public native boolean isSendingLocations();
public native boolean isMuted ();
public native boolean isContactRequest ();
@@ -70,7 +69,7 @@ public class DcChat {
}
public boolean isHalfBlocked() {
return isProtectionBroken() || isContactRequest();
return isContactRequest();
}
// working with raw c-data
+1 -1
View File
@@ -33,9 +33,9 @@ public class DcMsg {
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_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_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_IN_FRESH = 10;
@@ -81,7 +81,7 @@ public abstract class BaseConversationItem extends LinearLayout
protected boolean shouldInterceptClicks(DcMsg messageRecord) {
return batchSelected.isEmpty()
&& (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_INVALID_UNENCRYPTED_MAIL);
}
@@ -129,9 +129,7 @@ public abstract class BaseConversationItem extends LinearLayout
.setPositiveButton(R.string.ok, null)
.create();
d.show();
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_DISABLED) {
DcHelper.showVerificationBrokenDialog(context, conversationRecipient.getName());
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED) {
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_CHAT_E2EE || messageRecord.getInfoType() == DcMsg.DC_INFO_PROTECTION_ENABLED) {
DcHelper.showProtectionEnabledDialog(context);
} else if (messageRecord.getInfoType() == DcMsg.DC_INFO_INVALID_UNENCRYPTED_MAIL) {
DcHelper.showInvalidUnencryptedDialog(context);
@@ -1623,15 +1623,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
});
if (dcChat.isProtectionBroken()) {
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) {
if (dcChat.getType() == DcChat.DC_CHAT_TYPE_GROUP) {
// We don't support blocking groups yet, so offer to delete it instead
messageRequestBottomView.setBlockText(R.string.delete);
messageRequestBottomView.setBlockOnClickListener(v -> handleDeleteChat());
@@ -116,9 +116,6 @@ public class ConversationUpdateItem extends BaseConversationItem
if (infoType == DcMsg.DC_INFO_PROTECTION_ENABLED) {
verifiedIcon.setVisibility(VISIBLE);
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 {
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) {
new AlertDialog.Builder(context)
.setMessage(context.getString(R.string.chat_protection_enabled_explanation))