Merge branch 'main' into adb/integrated-videocalls

This commit is contained in:
adb
2025-09-02 14:15:25 +02:00
committed by GitHub
11 changed files with 89 additions and 117 deletions
+2
View File
@@ -4,8 +4,10 @@
* target Android 15
* improve readability of info messages in dark mode
* drop too short disappearing messages options
* fix Direct Share shortcuts
* fix: don't show error message when cancelling profile creation
* enable permanent notification by default if push notifications are not available
## v2.11.0
2025-08
Generated
+15 -15
View File
@@ -7,11 +7,11 @@
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1733948466,
"narHash": "sha256-o/uq/tU458Ykudi8Zk3sRga5iazkuSczt9wDOCUDOSU=",
"lastModified": 1756239746,
"narHash": "sha256-0ibN685tT+u/Nbmbrrq9G3mRUzct2Votyv/a7Wwv26s=",
"owner": "tadfisher",
"repo": "android-nixpkgs",
"rev": "0bf99ffaea6a7c0948ae10cf2e40c2905e4e4d6b",
"rev": "256631d162ec883b2341ee59621516e1f65f0f6b",
"type": "github"
},
"original": {
@@ -28,11 +28,11 @@
]
},
"locked": {
"lastModified": 1728330715,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"lastModified": 1741473158,
"narHash": "sha256-kWNaq6wQUbUMlPgw8Y+9/9wP0F8SHkjy24/mN3UAppg=",
"owner": "numtide",
"repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"rev": "7c9e793ebe66bcba8292989a68c0419b737a22a0",
"type": "github"
},
"original": {
@@ -79,11 +79,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1733759999,
"narHash": "sha256-463SNPWmz46iLzJKRzO3Q2b0Aurff3U1n0nYItxq7jU=",
"lastModified": 1756125398,
"narHash": "sha256-XexyKZpf46cMiO5Vbj+dWSAXOnr285GHsMch8FBoHbc=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "a73246e2eef4c6ed172979932bc80e1404ba2d56",
"rev": "3b9f00d7a7bf68acd4c4abb9d43695afb04e03a5",
"type": "github"
},
"original": {
@@ -95,11 +95,11 @@
},
"nixpkgs_2": {
"locked": {
"lastModified": 1733749988,
"narHash": "sha256-+5qdtgXceqhK5ZR1YbP1fAUsweBIrhL38726oIEAtDs=",
"lastModified": 1756159630,
"narHash": "sha256-ohMvsjtSVdT/bruXf5ClBh8ZYXRmD4krmjKrXhEvwMg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "bc27f0fde01ce4e1bfec1ab122d72b7380278e68",
"rev": "84c256e42600cb0fdf25763b48d28df2f25a0c8b",
"type": "github"
},
"original": {
@@ -138,11 +138,11 @@
"nixpkgs": "nixpkgs_3"
},
"locked": {
"lastModified": 1747017456,
"narHash": "sha256-C/U12fcO+HEF071b5mK65lt4XtAIZyJSSJAg9hdlvTk=",
"lastModified": 1756197489,
"narHash": "sha256-S16rPaBH1TnMbDyL5NlGSJcYd7wPlOEWTStdBDL7BHw=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "5b07506ae89b025b14de91f697eba23b48654c52",
"rev": "8ec04f46f1edeeed3f870da62191745b93975da7",
"type": "github"
},
"original": {
+1 -1
View File
@@ -18,7 +18,7 @@
build-tools-35-0-0
cmdline-tools-latest
platform-tools
platforms-android-34
platforms-android-35
ndk-27-2-12479018
]);
rust-version = pkgs.lib.removeSuffix "\n"
@@ -42,4 +42,14 @@ public class DcAccounts {
private native long getJsonrpcInstanceCPtr ();
private native long getAccountCPtr (int accountId);
private native long getSelectedAccountCPtr ();
public boolean isAllChatmail() {
for (int accountId : getAll()) {
DcContext dcContext = getAccount(accountId);
if (!dcContext.isChatmail()) {
return false;
}
}
return true;
}
}
@@ -60,14 +60,12 @@ public class EphemeralMessagesDialog {
.setPositiveButton(R.string.ok, (dialog, which) -> {
final long burnAfter;
switch (selectedChoice[0]) {
case 1: burnAfter = TimeUnit.MINUTES.toSeconds(1); break;
case 2: burnAfter = TimeUnit.MINUTES.toSeconds(5); break;
case 3: burnAfter = TimeUnit.MINUTES.toSeconds(30); break;
case 4: burnAfter = TimeUnit.HOURS.toSeconds(1); break;
case 5: burnAfter = TimeUnit.DAYS.toSeconds(1); break;
case 6: burnAfter = TimeUnit.DAYS.toSeconds(7); break;
case 7: burnAfter = TimeUnit.DAYS.toSeconds(35); break;
case 8: burnAfter = TimeUnit.DAYS.toSeconds(365); break;
case 1: burnAfter = TimeUnit.MINUTES.toSeconds(5); break;
case 2: burnAfter = TimeUnit.HOURS.toSeconds(1); break;
case 3: burnAfter = TimeUnit.DAYS.toSeconds(1); break;
case 4: burnAfter = TimeUnit.DAYS.toSeconds(7); break;
case 5: burnAfter = TimeUnit.DAYS.toSeconds(35); break;
case 6: burnAfter = TimeUnit.DAYS.toSeconds(365); break;
default: burnAfter = 0; break;
}
listener.onTimeSelected(burnAfter);
@@ -84,30 +82,23 @@ public class EphemeralMessagesDialog {
if (timespan == 0) {
return 0; // off
}
// Choose timespan close to the current one out of available options.
if (timespan < TimeUnit.MINUTES.toSeconds(5)) {
return 1; // 1 minute
}
if (timespan < TimeUnit.MINUTES.toSeconds(30)) {
return 2; // 5 minutes
}
if (timespan < TimeUnit.HOURS.toSeconds(1)) {
return 3; // 30 minutes
return 1; // 5 minutes
}
if (timespan < TimeUnit.DAYS.toSeconds(1)) {
return 4; // 1 hour
return 2; // 1 hour
}
if (timespan < TimeUnit.DAYS.toSeconds(7)) {
return 5; // 1 day
return 3; // 1 day
}
if (timespan < TimeUnit.DAYS.toSeconds(35)) {
return 6; // 1 week
return 4; // 1 week
}
if (timespan < TimeUnit.DAYS.toSeconds(365)) {
return 7; // 5 weeks
return 5; // 5 weeks
}
return 8; // 1 year
return 6; // 1 year
}
}
@@ -109,18 +109,9 @@ public class DozeReminder {
}
}
private static boolean isAllChatmail() {
for (int accountId : ApplicationContext.dcAccounts.getAll()) {
DcContext context = ApplicationContext.dcAccounts.getAccount(accountId);
if (!context.isChatmail()) {
return false;
}
}
return true;
}
private static boolean isPushAvailableAndSufficient() {
return isAllChatmail() && FcmReceiveService.getToken() != null;
return ApplicationContext.dcAccounts.isAllChatmail()
&& FcmReceiveService.getToken() != null;
}
public static void maybeAskDirectly(Context context) {
@@ -30,7 +30,7 @@ import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.connect.KeepAliveService;
import org.thoughtcrime.securesms.util.Prefs;
public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragment {
public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragment implements Preference.OnPreferenceChangeListener {
private static final String TAG = NotificationsPreferenceFragment.class.getSimpleName();
private static final int REQUEST_CODE_NOTIFICATION_SELECTED = 1;
@@ -38,6 +38,7 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
private CheckBoxPreference ignoreBattery;
private CheckBoxPreference notificationsEnabled;
private CheckBoxPreference mentionNotifEnabled;
private CheckBoxPreference reliableService;
@Override
public void onCreate(Bundle paramBundle) {
@@ -85,18 +86,12 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
}
CheckBoxPreference reliableService = this.findPreference("pref_reliable_service");
// reliableService is just used for displaying the actual value
// of the reliable service preference that is managed via
// Prefs.setReliableService() and Prefs.reliableService()
reliableService = this.findPreference("pref_reliable_service2");
if (reliableService != null) {
reliableService.setOnPreferenceChangeListener((preference, newValue) -> {
Context context = getContext();
boolean enabled = (Boolean) newValue; // Prefs.reliableService() still has the old value
if (enabled) {
KeepAliveService.startSelf(context);
} else {
context.stopService(new Intent(context, KeepAliveService.class));
}
return true;
});
reliableService.setOnPreferenceChangeListener(this);
}
notificationsEnabled = this.findPreference("pref_enable_notifications");
@@ -132,6 +127,11 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
ignoreBattery.setChecked(isIgnoringBatteryOptimizations());
notificationsEnabled.setChecked(!dcContext.isMuted());
mentionNotifEnabled.setChecked(dcContext.isMentionsEnabled());
// set without altering "unset" state of the preference
reliableService.setOnPreferenceChangeListener(null);
reliableService.setChecked(Prefs.reliableService(getActivity()));
reliableService.setOnPreferenceChangeListener(this);
}
@Override
@@ -150,6 +150,19 @@ public class NotificationsPreferenceFragment extends ListSummaryPreferenceFragme
}
}
@Override
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
Context context = getContext();
boolean enabled = (Boolean) newValue;
Prefs.setReliableService(context, enabled);
if (enabled) {
KeepAliveService.startSelf(context);
} else {
context.stopService(new Intent(context, KeepAliveService.class));
}
return true;
}
private class RingtoneSummaryListener implements Preference.OnPreferenceChangeListener {
@Override
public boolean onPreferenceChange(@NonNull Preference preference, Object newValue) {
@@ -12,10 +12,12 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import com.b44t.messenger.DcAccounts;
import com.b44t.messenger.DcContext;
import org.thoughtcrime.securesms.BuildConfig;
import org.thoughtcrime.securesms.connect.DcHelper;
import org.thoughtcrime.securesms.notifications.FcmReceiveService;
import org.thoughtcrime.securesms.preferences.widgets.NotificationPrivacyPreference;
import java.util.ArrayList;
@@ -28,6 +30,7 @@ public class Prefs {
private static final String TAG = Prefs.class.getSimpleName();
public static final String RELIABLE_SERVICE_PREF = "pref_reliable_service";
public static final String DISABLE_PASSPHRASE_PREF = "pref_disable_passphrase";
public static final String THEME_PREF = "pref_theme";
public static final String BACKGROUND_PREF = "pref_chat_background";
@@ -212,13 +215,20 @@ public class Prefs {
return result==null? null : Uri.parse(result);
}
public static void setReliableService(Context context, boolean value) {
setBooleanPreference(context, RELIABLE_SERVICE_PREF, value);
}
public static boolean reliableService(Context context) {
try {
return getBooleanPreference(context, "pref_reliable_service", false);
}
catch(Exception e) {
return false;
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
if (prefs.contains(RELIABLE_SERVICE_PREF)) {
try {
return prefs.getBoolean(RELIABLE_SERVICE_PREF, true);
} catch(Exception e) {}
}
// if the key was unset, then calculate default value
return isPushEnabled(context) || !DcHelper.getAccounts(context).isAllChatmail();
}
// vibrate
+6 -8
View File
@@ -49,14 +49,12 @@
<string-array name="ephemeral_message_durations">
<!-- 0 --> <item>@string/off</item>
<!-- 1 --> <item>@string/after_1_minute</item>
<!-- 2 --> <item>@string/after_5_minutes</item>
<!-- 3 --> <item>@string/after_30_minutes</item>
<!-- 4 --> <item>@string/autodel_after_1_hour</item>
<!-- 5 --> <item>@string/autodel_after_1_day</item>
<!-- 6 --> <item>@string/autodel_after_1_week</item>
<!-- 7 --> <item>@string/after_5_weeks</item>
<!-- 8 --> <item>@string/autodel_after_1_year</item>
<!-- 1 --> <item>@string/after_5_minutes</item>
<!-- 2 --> <item>@string/autodel_after_1_hour</item>
<!-- 3 --> <item>@string/autodel_after_1_day</item>
<!-- 4 --> <item>@string/autodel_after_1_week</item>
<!-- 5 --> <item>@string/after_5_weeks</item>
<!-- 6 --> <item>@string/autodel_after_1_year</item>
</string-array>
<string-array name="mute_durations">
-43
View File
@@ -240,12 +240,6 @@
<!-- "Chat" is a verb here, "Message to" would also fit. the string might be used in the "New Chat" screen above the contact list -->
<string name="chat_with">Chat with…</string>
<string name="clone_chat">Clone Chat</string>
<!-- deprecated -->
<string name="broadcast_list">Broadcast List</string>
<!-- deprecated -->
<string name="broadcast_lists">Broadcast Lists</string>
<!-- deprecated -->
<string name="new_broadcast_list">New Broadcast List</string>
<!-- consider keeping the term "channel" as in WhatsApp or Telegram -->
<string name="channel">Channel</string>
<!-- consider keeping the term "channel" as in WhatsApp or Telegram -->
@@ -253,12 +247,6 @@
<!-- consider keeping the term "channel" as in WhatsApp or Telegram -->
<string name="new_channel">New Channel</string>
<string name="add_recipients">Add Recipients</string>
<!-- deprecated -->
<string name="edit_broadcast_list">Edit Broadcast List</string>
<!-- deprecated -->
<string name="broadcast_list_name">Broadcast List Name</string>
<!-- deprecated -->
<string name="please_enter_broadcast_list_name">Please enter a name for the broadcast list.</string>
<!-- consider keeping the term "channel" as in WhatsApp or Telegram -->
<string name="channel_name">Channel Name</string>
<string name="email">E-Mail</string>
@@ -424,8 +412,6 @@
<string name="ask_start_chat_with">Chat with %1$s?</string>
<!-- %1$s is replaced by a comma-separated list of names -->
<string name="ask_remove_members">Remove %1$s from group?</string>
<!-- deprecated -->
<string name="ask_remove_from_broadcast">Remove %1$s from broadcast list?</string>
<!-- %1$s is replaced by a comma-separated list of names -->
<string name="ask_remove_from_channel">Remove %1$s from channel?</string>
<string name="open_url_confirmation">Do you want to open this link?</string>
@@ -457,8 +443,6 @@
</plurals>
<!-- The placeholder will be replaced by the name of the recipient in a one-to-one chat. -->
<string name="chat_new_one_to_one_hint">Send a message to %1$s.</string>
<!-- deprecated -->
<string name="chat_new_broadcast_hint">In a broadcast list, recipients will receive messages in a read-only chat with you.</string>
<!-- consider keeping the term "channel" as in WhatsApp or Telegram -->
<string name="chat_new_channel_hint">Channels are a one-to-many tool for broadcasting your messages.</string>
<string name="chat_new_group_hint">Others will only see this group after you sent a first message.</string>
@@ -569,11 +553,6 @@
<!-- option to show images in the gallery as square (instead of using correct width/height) -->
<string name="square_grid">Square Grid</string>
<string name="send_message">Send Message</string>
<!-- deprecated, was stock string -->
<string name="aeap_addr_changed">%1$s changed their address from %2$s to %3$s</string>
<!-- deprecated -->
<string name="aeap_explanation">You changed your email address from %1$s to %2$s.\n\nIf you now send a message to a verified group, contacts there will automatically replace the old with your new address.\n\nIt\'s highly advised to set up your old email provider to forward all emails to your new email address. Otherwise you might miss messages of contacts who did not get your new address yet.</string>
<!-- Multi Device -->
<!-- "Second Device" can also be translated as "Another Device", if that is catchier in the destination language. However, make sure to use the term consistently. -->
@@ -975,14 +954,8 @@
<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 -->
<string name="ephemeral_timer_weeks_by_other">Disappearing messages timer set to %1$s weeks by %2$s.</string>
<!-- deprecated -->
<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_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>
<!-- deprecated -->
<string name="chat_protection_broken_tap_to_learn_more">%1$s sent a message from another device. Tap to learn more.</string>
<!-- deprecated -->
<string name="chat_protection_broken_explanation">End-to-end encryption cannot be guaranteed anymore, likely because %1$s reinstalled Delta Chat or sent a message from another device.\n\nYou may meet them in person and scan their QR code again to reestablish guaranteed end-to-end encryption.</string>
<string name="invalid_unencrypted_tap_to_learn_more">⚠️ %1$s requires end-to-end encryption which is not setup for this chat yet. Tap to learn more.</string>
<string name="invalid_unencrypted_explanation">To establish end-to-end-encryption, you may meet contacts in person and scan their QR Code to introduce them.</string>
<string name="learn_more">Learn More</string>
@@ -1041,19 +1014,11 @@
<!-- 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>
<!-- deprecated -->
<string name="secure_join_wait_timeout">Could not yet establish guaranteed end-to-end encryption, but you may already send a message.</string>
<!-- deprecated, was stock string -->
<string name="secure_join_takes_longer">The contact must be online to proceed.\n\nThis process will continue automatically in background.</string>
<string name="contact_verified">%1$s introduced.</string>
<!-- deprecated, was stock string -->
<string name="contact_not_verified">Cannot establish end-to-end encryption with %1$s.</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>
<string name="verified_by_you">Introduced by me</string>
<string name="verified_by_unknown">Introduced</string>
<!-- deprecated, was stock string -->
<string name="contact_setup_changed">Changed setup for %1$s.</string>
<string name="verified_contact_required_explain">To guarantee end-to-end-encryption, you can only add contacts with a green checkmark to this group.\n\nYou may meet contacts in person and scan their QR Code to introduce them.</string>
<string name="mailto_dialog_header_select_chat">Select chat to send the message to</string>
<!-- first placeholder is the name of the chat -->
@@ -1096,9 +1061,6 @@
<string name="ImageEditorHud_flip">Flip</string>
<string name="ImageEditorHud_rotate">Rotate</string>
<!-- deprecated, use string "E-Mail" for non-encrypted messages instead -->
<string name="encrypted_message">Encrypted message</string>
<!-- strings introduced on desktop. we want to share strings between the os, in general, please do not add generic strings here -->
<string name="about_offical_app_desktop">This is the official Delta Chat Desktop app.</string>
<string name="about_licensed_under_desktop">This software is licensed under GNU GPL version 3 and the source code is available on GitHub.</string>
@@ -1213,7 +1175,6 @@
<string name="InfoPlist_NSPhotoLibraryAddUsageDescription">Delta Chat wants to save images to your photo library.</string>
<string name="InfoPlist_NSFaceIDUsageDescription">Delta Chat can use Face ID to protect your local profile, backup creation and second device setup.</string>
<!-- android specific strings, developers: please take care to remove strings that are no longer used! -->
<string name="pref_instant_delivery">Instant Delivery</string>
<string name="pref_background_notifications">Use Background Connection</string>
@@ -1228,8 +1189,4 @@
<!-- device messages for updates -->
<string name="update_2_0">What\'s new?\n\n💯 End-to-end encryption is reliable and forever now. Padlocks 🔒 are gone!\n\n✉️ Classic email without end-to-end encryption is marked with a letter symbol\n\n😻 New enhanced profile screen for all your contacts\n\n🔲 New button for quick access to apps used in a chat\n\n❤️ Please donate to help us remain independent and continue to bring improvements: %1$s</string>
<!-- deprecated -->
<string name="update_1_50_android">What\'s new?\n\n❤️‍🔥 New emojis picker with more emoji\n\n🎮 Enhanced in-chat apps: Get notifications and open supporting apps in context, i.e. open an added calendar entry directly\n\n👍 Get notified about reactions to your messages\n\n... 🛠️ FIXES and EVEN MORE at %1$s</string>
<!-- deprecated -->
<string name="update_switch_profile_placement">️ \"Switch Profile\" option moved: Tap your profile image in the upper corner of the main screen to add or switch profiles 💡</string>
</resources>
@@ -64,7 +64,7 @@
android:summary="@string/pref_background_notifications_explain"/>
<org.thoughtcrime.securesms.components.SwitchPreferenceCompat
android:key="pref_reliable_service"
android:key="pref_reliable_service2"
android:defaultValue="false"
android:title="@string/pref_reliable_service"
android:summary="@string/pref_reliable_service_explain"/>