Merge branch 'main' into adb/issue-3829

This commit is contained in:
adb
2025-11-15 23:12:52 +01:00
committed by GitHub
8 changed files with 46 additions and 19 deletions
@@ -68,8 +68,10 @@ public class DcContext {
public final static int DC_QR_ERROR = 400;
public final static int DC_QR_WITHDRAW_VERIFYCONTACT = 500;
public final static int DC_QR_WITHDRAW_VERIFYGROUP = 502;
public final static int DC_QR_WITHDRAW_JOINBROADCAST = 504;
public final static int DC_QR_REVIVE_VERIFYCONTACT = 510;
public final static int DC_QR_REVIVE_VERIFYGROUP = 512;
public final static int DC_QR_REVIVE_JOINBROADCAST = 514;
public final static int DC_QR_LOGIN = 520;
public final static int DC_SOCKET_AUTO = 0;
@@ -127,7 +127,7 @@ public class RegistrationActivity extends BaseActionBarActivity implements DcEve
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setTitle(
isConfigured? R.string.pref_password_and_account_settings : R.string.manual_account_setup_option
isConfigured? R.string.edit_transport : R.string.manual_account_setup_option
);
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeAsUpIndicator(R.drawable.ic_close_white_24dp);
@@ -223,7 +223,7 @@ public class AdvancedPreferenceFragment extends ListSummaryPreferenceFragment
Preference passwordAndAccount = this.findPreference("password_account_settings_button");
if (passwordAndAccount != null) {
passwordAndAccount.setOnPreferenceClickListener(((preference) -> {
boolean result = ScreenLockUtil.applyScreenLock(requireActivity(), getString(R.string.pref_password_and_account_settings), getString(R.string.enter_system_secret_to_continue), REQUEST_CODE_CONFIRM_CREDENTIALS_ACCOUNT);
boolean result = ScreenLockUtil.applyScreenLock(requireActivity(), getString(R.string.edit_transport), getString(R.string.enter_system_secret_to_continue), REQUEST_CODE_CONFIRM_CREDENTIALS_ACCOUNT);
if (!result) {
openRegistrationActivity();
}
@@ -112,8 +112,10 @@ public class QrCodeHandler {
case DcContext.DC_QR_WITHDRAW_VERIFYCONTACT:
case DcContext.DC_QR_WITHDRAW_VERIFYGROUP:
case DcContext.DC_QR_WITHDRAW_JOINBROADCAST:
String message = qrParsed.getState() == DcContext.DC_QR_WITHDRAW_VERIFYCONTACT ? activity.getString(R.string.withdraw_verifycontact_explain)
: activity.getString(R.string.withdraw_verifygroup_explain, qrParsed.getText1());
: qrParsed.getState() == DcContext.DC_QR_WITHDRAW_VERIFYCONTACT ? activity.getString(R.string.withdraw_verifygroup_explain, qrParsed.getText1())
: activity.getString(R.string.withdraw_joinbroadcast_explain, qrParsed.getText1());
builder.setTitle(R.string.qrshow_title);
builder.setMessage(message);
builder.setNeutralButton(R.string.reset, (dialog, which) -> {
@@ -126,6 +128,7 @@ public class QrCodeHandler {
case DcContext.DC_QR_REVIVE_VERIFYCONTACT:
case DcContext.DC_QR_REVIVE_VERIFYGROUP:
case DcContext.DC_QR_REVIVE_JOINBROADCAST:
builder.setTitle(R.string.qrshow_title);
builder.setMessage(activity.getString(R.string.revive_verifycontact_explain));
builder.setNeutralButton(R.string.revive_qr_code, (dialog, which) -> {
@@ -17,6 +17,7 @@ import androidx.annotation.NonNull;
import androidx.appcompat.app.AlertDialog;
import androidx.fragment.app.Fragment;
import com.b44t.messenger.DcChat;
import com.b44t.messenger.DcContext;
import com.b44t.messenger.DcEvent;
import com.caverock.androidsvg.SVG;
@@ -143,8 +144,17 @@ public class QrShowFragment extends Fragment implements DcEventCenter.DcEventDel
public void withdrawQr() {
Activity activity = getActivity();
String message = chatId == 0 ? activity.getString(R.string.withdraw_verifycontact_explain)
: activity.getString(R.string.withdraw_verifygroup_explain, dcContext.getChat(chatId).getName());
String message;
if (chatId == 0) {
message = activity.getString(R.string.withdraw_verifycontact_explain);
} else {
DcChat chat = dcContext.getChat(chatId);
if (chat.getType() == DcChat.DC_CHAT_TYPE_GROUP) {
message = activity.getString(R.string.withdraw_verifygroup_explain, chat.getName());
} else {
message = activity.getString(R.string.withdraw_joinbroadcast_explain, chat.getName());
}
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(R.string.withdraw_qr_code);
builder.setMessage(message);
+10 -10
View File
@@ -24,16 +24,6 @@
android:layout_marginBottom="16dp"
android:text="@string/instant_onboarding_other_server"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/manual_account_setup_option"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/scan_qr_button"
@@ -41,8 +31,18 @@
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:layout_marginBottom="16dp"
android:text="@string/scan_invitation_code"/>
<Button
style="@style/ButtonSecondary"
android:id="@+id/login_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="24dp"
android:paddingRight="24dp"
android:text="@string/manual_account_setup_option"/>
</LinearLayout>
</ScrollView>
+15 -3
View File
@@ -615,8 +615,8 @@
<string name="onboarding_create_instant_account">Create New Profile</string>
<!-- Secondary button on the welcome screen, allows to "Add as Second Device", "Restore from Backup" -->
<string name="onboarding_alternative_logins">I Already Have a Profile</string>
<!-- Button, allows to log in to existing email accounts, setting ports, passwords and so on -->
<string name="manual_account_setup_option">Classic Email Login</string>
<!-- Stay short here, alternative source string could be "Transport over Classic Email", avoiding maybe the maybe long term "Use". Context: this is Button and a title, allowing to log in to existing, classic email accounts, setting ports, passwords and so on -->
<string name="manual_account_setup_option">Use Classic Email as Transport</string>
<!-- Instant onboarding title (there is not more to do than to set name and avatar) -->
<string name="instant_onboarding_title">Your Profile</string>
<!-- The placeholder will be replaced by the default onboarding server -->
@@ -677,6 +677,15 @@
<string name="proxy_share_link">Share Link</string>
<string name="proxy_enabled">Proxy Enabled</string>
<string name="proxy_enabled_hint">You are using a proxy. If you\'re having trouble connecting, try a different proxy.</string>
<!-- "Transports", these are the relay servers used, can also be translated as "Transport Servers", if only "Transport" sounds too weird in the destination language -->
<string name="transports">Transports</string>
<string name="add_transport">Add Transport</string>
<string name="remove_transport">Remove Transport</string>
<string name="edit_transport">Edit Transport</string>
<!-- shown if a QR code was scanned that can be used as a transport -->
<string name="confirm_add_transport">Add this transport?</string>
<string name="invalid_transport_qr">The scanned QR code does not contain a valid transport.</string>
<string name="confirm_remove_transport">Remove transport \"%1$s\"?\n\nYour contacts can only reach you if you\'ve previously contacted them via another transport.\n\nIf in doubt, remove the transport later.</string>
<!-- deprecated -->
<string name="login_info_oauth2_title">Continue with simplified setup?</string>
@@ -730,6 +739,7 @@
<string name="pref_profile_photo">Profile Image</string>
<string name="pref_blocked_contacts">Blocked Contacts</string>
<string name="blocked_empty_hint">Blocked contacts will appear here.</string>
<!-- deprecated -->
<string name="pref_password_and_account_settings">Password and Account</string>
<string name="pref_who_can_see_profile_explain">Your profile image, name and bio will be sent together with your messages when communicating with other users.</string>
<string name="pref_your_name">Your Name</string>
@@ -1001,9 +1011,11 @@
<string name="qrscan_fingerprint_label">Fingerprint</string>
<string name="withdraw_verifycontact_explain">This QR code can be scanned by others to contact you.\n\nYou can reset it, so that the existing QR code or invite link will no longer work.</string>
<string name="withdraw_verifygroup_explain">This QR code can be scanned by others to join the group \"%1$s\".\n\nYou can reset it, so that the existing QR code or invite link will no longer work.</string>
<string name="withdraw_joinbroadcast_explain">This QR code can be scanned by others to join the channel \"%1$s\".\n\nYou can reset it, so that the existing QR code or invite link will no longer work.</string>
<string name="withdraw_qr_code">Reset QR Code</string>
<string name="revive_verifycontact_explain">This QR code has been reset and is no longer active.</string>
<string name="revive_verifygroup_explain">This QR code to join group \"%1$s\" has been reset and is no longer active.</string>
<string name="revive_joinbroadcast_explain">This QR code to join channel \"%1$s\" has been reset and is no longer active.</string>
<string name="revive_qr_code">Activate QR Code</string>
<string name="qrshow_title">QR Invite Code</string>
<string name="qrshow_x_joining">%1$s joins.</string>
@@ -1030,7 +1042,7 @@
<string name="secure_join_started">%1$s invited you to join this group.\n\nWaiting for the device of %2$s to reply…</string>
<!-- placeholder will be replaced by the name of the inviter. -->
<string name="secure_join_replies">%1$s replied, waiting for being added to the group…</string>
<string name="secure_join_wait">Establishing end-to-end encryption, please wait…</string>
<string name="secure_join_wait">Establishing connection, please wait…</string>
<string name="contact_verified">%1$s introduced.</string>
<!-- Shown in contact profile. The placeholder will be replaced by the name of the contact that introduced the contact. -->
<string name="verified_by">Introduced by %1$s</string>
+1 -1
View File
@@ -65,7 +65,7 @@
<PreferenceCategory android:title="@string/pref_server">
<Preference android:key="password_account_settings_button"
android:title="@string/pref_password_and_account_settings"/>
android:title="@string/edit_transport"/>
<Preference android:key="proxy_settings_button"
android:title="@string/proxy_settings"/>