mirror of
https://github.com/ArcaneChat/android.git
synced 2026-06-02 11:43:40 +02:00
Merge remote-tracking branch 'upstream/main'
This commit is contained in:
@@ -10,9 +10,12 @@
|
||||
* Allow to share location for 24 hours
|
||||
* Allow mini-apps to play audio without user interaction
|
||||
* Mark chats as unread (long tap a chat and select the corresponding option from the three-dot-menu)
|
||||
* Add "Mark all as read" option to profile menu in the profile switcher
|
||||
* Fix process of upgrading from a very old version of the app
|
||||
* Show more recent added stickers at the top of the sticker picker
|
||||
* Allow to open links in messages via actions in TalkBack menu
|
||||
* Allow to open map if user clicks "Location streaming enabled" system message
|
||||
* Fix: do not accidentally set draft in chats that don't allow sending messages
|
||||
|
||||
## v2.49.0
|
||||
2026-04
|
||||
|
||||
@@ -676,8 +676,14 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
}
|
||||
|
||||
public void setDraftText(String txt) {
|
||||
composeText.setText(txt);
|
||||
composeText.setSelection(composeText.getText().length());
|
||||
try {
|
||||
if (rpc.canSend(rpc.getSelectedAccountId(), chatId)) {
|
||||
composeText.setText(txt);
|
||||
composeText.setSelection(composeText.getText().length());
|
||||
}
|
||||
} catch (RpcException e) {
|
||||
Log.e(TAG, "Rpc error", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void hideSoftKeyboard() {
|
||||
@@ -1123,6 +1129,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
if (chatId == DcChat.DC_CHAT_NO_CHAT)
|
||||
throw new IllegalStateException("can't display a conversation for no chat.");
|
||||
dcChat = DcHelper.getContext(context).getChat(chatId);
|
||||
attachmentTypeSelector = null;
|
||||
recipient = new Recipient(this, dcChat);
|
||||
glideRequests = GlideApp.with(this);
|
||||
|
||||
@@ -1271,6 +1278,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
|
||||
DcContext dcContext = DcHelper.getContext(context);
|
||||
final int currentChatId = dcChat.getId();
|
||||
final boolean canSend = dcChat.canSend();
|
||||
Util.runOnAnyBackgroundThread(
|
||||
() -> {
|
||||
DcMsg msg = null;
|
||||
@@ -1393,7 +1401,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dcContext.setDraft(currentChatId, msg);
|
||||
// set or clear draft if user can't send in chat since they can't delete it otherwise
|
||||
dcContext.setDraft(currentChatId, canSend ? msg : null);
|
||||
}
|
||||
future.set(currentChatId);
|
||||
});
|
||||
|
||||
@@ -24,6 +24,7 @@ import android.graphics.PorterDuff;
|
||||
import android.graphics.Rect;
|
||||
import android.os.Build;
|
||||
import android.text.Spannable;
|
||||
import android.text.Spanned;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
@@ -36,6 +37,7 @@ import androidx.annotation.DimenRes;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AlertDialog;
|
||||
import androidx.core.view.ViewCompat;
|
||||
import chat.delta.rpc.RpcException;
|
||||
import chat.delta.rpc.types.CallInfo;
|
||||
import chat.delta.rpc.types.CallState;
|
||||
@@ -44,6 +46,7 @@ import chat.delta.rpc.types.VcardContact;
|
||||
import com.b44t.messenger.DcChat;
|
||||
import com.b44t.messenger.DcContact;
|
||||
import com.b44t.messenger.DcMsg;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import org.thoughtcrime.securesms.calls.CallCoordinator;
|
||||
@@ -72,6 +75,7 @@ import org.thoughtcrime.securesms.mms.VcardSlide;
|
||||
import org.thoughtcrime.securesms.reactions.ReactionsConversationView;
|
||||
import org.thoughtcrime.securesms.recipients.Recipient;
|
||||
import org.thoughtcrime.securesms.util.Linkifier;
|
||||
import org.thoughtcrime.securesms.util.LongClickCopySpan;
|
||||
import org.thoughtcrime.securesms.util.LongClickMovementMethod;
|
||||
import org.thoughtcrime.securesms.util.MarkdownUtil;
|
||||
import org.thoughtcrime.securesms.util.MediaUtil;
|
||||
@@ -120,6 +124,9 @@ public class ConversationItem extends BaseConversationItem {
|
||||
private Stub<CallItemView> callViewStub;
|
||||
private @Nullable EventListener eventListener;
|
||||
|
||||
// IDs of accessibility actions registered via ViewCompat.addAccessibilityAction
|
||||
private final List<Integer> linkActionIds = new ArrayList<>();
|
||||
|
||||
private int measureCalls;
|
||||
|
||||
private int incomingBubbleColor;
|
||||
@@ -424,6 +431,12 @@ public class ConversationItem extends BaseConversationItem {
|
||||
bodyText.setClickable(false);
|
||||
bodyText.setFocusable(false);
|
||||
|
||||
// Remove any link actions registered for the previous message binding
|
||||
for (int id : linkActionIds) {
|
||||
ViewCompat.removeAccessibilityAction(this, id);
|
||||
}
|
||||
linkActionIds.clear();
|
||||
|
||||
String subject = messageRecord.getSubject();
|
||||
String text = messageRecord.getText();
|
||||
|
||||
@@ -433,12 +446,33 @@ public class ConversationItem extends BaseConversationItem {
|
||||
if (messageRecord.getType() == DcMsg.DC_MSG_CALL || text.isEmpty()) {
|
||||
bodyText.setVisibility(View.GONE);
|
||||
} else {
|
||||
Spannable spannable = (Spannable) MarkdownUtil.toMarkdown(context, text);
|
||||
Spannable spannable = MarkdownUtil.toMarkdown(context, text);
|
||||
if (batchSelected.isEmpty()) {
|
||||
spannable = Linkifier.linkify(spannable);
|
||||
Linkifier.linkify(spannable);
|
||||
}
|
||||
bodyText.setText(spannable);
|
||||
bodyText.setVisibility(View.VISIBLE);
|
||||
|
||||
// Register a TalkBack "Actions" entry for each link in the message
|
||||
Spanned spanned = (Spanned) spannable;
|
||||
final TextView tv = bodyText;
|
||||
for (LongClickCopySpan span :
|
||||
spanned.getSpans(0, spanned.length(), LongClickCopySpan.class)) {
|
||||
int start = spanned.getSpanStart(span);
|
||||
int end = spanned.getSpanEnd(span);
|
||||
if (start >= 0 && end > start && end <= spanned.length()) {
|
||||
String linkText = spanned.subSequence(start, end).toString();
|
||||
String label = context.getString(R.string.accessibility_link_action, linkText);
|
||||
linkActionIds.add(
|
||||
ViewCompat.addAccessibilityAction(
|
||||
this,
|
||||
label,
|
||||
(v, args) -> {
|
||||
span.onClick(tv);
|
||||
return true;
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int downloadState = messageRecord.getDownloadState();
|
||||
|
||||
@@ -157,6 +157,12 @@ public class AccountSelectionListFragment extends DialogFragment
|
||||
onSetTag(accountId);
|
||||
} else if (itemId == R.id.menu_move_to_top) {
|
||||
onMoveToTop(accountId);
|
||||
} else if (itemId == R.id.menu_mark_all_as_read) {
|
||||
try {
|
||||
DcHelper.getRpc(requireActivity()).marknoticedAllChats(accountId);
|
||||
} catch (RpcException e) {
|
||||
Log.e(TAG, "Error calling rpc.marknoticedAllChats()", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,10 @@ public class AttachmentTypeSelector extends PopupWindow {
|
||||
ViewUtil.findById(layout, R.id.location_linear_layout).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
if (DcHelper.getContext(context).getChat(chatId).isOutBroadcast()) {
|
||||
ViewUtil.findById(layout, R.id.webxdc_linear_layout).setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
setLocationButtonImage(context);
|
||||
|
||||
setContentView(layout);
|
||||
|
||||
@@ -126,6 +126,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/webxdc_linear_layout"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:title="@string/mark_all_as_read"
|
||||
android:id="@+id/menu_mark_all_as_read" />
|
||||
|
||||
<item
|
||||
android:title="@string/menu_mute"
|
||||
android:id="@+id/menu_mute_notifications" />
|
||||
|
||||
@@ -814,16 +814,23 @@
|
||||
<string name="pref_background">Wallpaper</string>
|
||||
<string name="pref_background_btn_default">Use Default Image</string>
|
||||
<string name="pref_background_btn_gallery">Select From Gallery</string>
|
||||
<!-- deprecated -->
|
||||
<string name="pref_imap_folder_warn_disable_defaults">If you change this option, make sure, your server and your other clients are configured accordingly.\n\nOtherwise things may not work at all.</string>
|
||||
<!-- No need to be literal here, you can also use "Use Multiple Devices", "Support Multiple Devices" or other fitting terms. However, it should fit to the wording or your language at https://delta.chat/help -->
|
||||
<string name="pref_multidevice">Multi-Device Mode</string>
|
||||
<string name="pref_multidevice_explain">Synchronize your messages with your other devices. Automatically enabled on adding a second device</string>
|
||||
<string name="pref_multidevice_change_warn">Multi-Device Mode must be enabled when using the same profile on multiple devices. Only disable this setting if you have removed this profile from all your other devices.\n\nDisabling Multi-Device Mode while using the profile on multiple devices will result in missed messages and other problems.</string>
|
||||
<!-- deprecated -->
|
||||
<string name="pref_auto_folder_moves">Move automatically to DeltaChat Folder</string>
|
||||
<!-- deprecated -->
|
||||
<string name="pref_only_fetch_mvbox_title">Only Fetch from DeltaChat Folder</string>
|
||||
<!-- deprecated -->
|
||||
<string name="pref_show_emails">Show Classic Emails</string>
|
||||
<!-- deprecated -->
|
||||
<string name="pref_show_emails_no">No, chats only</string>
|
||||
<!-- deprecated -->
|
||||
<string name="pref_show_emails_accepted_contacts">For accepted contacts</string>
|
||||
<!-- deprecated -->
|
||||
<string name="pref_show_emails_all">All</string>
|
||||
<string name="pref_experimental_features">Experimental Features</string>
|
||||
<string name="pref_experimental_features_explain">These features may be unstable and may be changed or removed</string>
|
||||
@@ -878,14 +885,17 @@
|
||||
<!-- automatically delete message -->
|
||||
<string name="delete_old_messages">Delete Old Messages</string>
|
||||
<string name="autodel_device_title">Delete Messages from Device</string>
|
||||
<!-- deprecated -->
|
||||
<string name="autodel_server_title">Delete Messages from Server</string>
|
||||
<!-- %1$d will be replaced by the number of messages, you can assume plural/lots here. %2$s will be replaced by a timespan option. -->
|
||||
<string name="autodel_device_ask">Do you want to delete %1$d messages now and all newly fetched messages \"%2$s\" in the future?\n\n• This includes all media\n\n• Messages will be deleted whether they were seen or not\n\n• \"Saved messages\" will be skipped from local deletion</string>
|
||||
<!-- %1$d will be replaced by the number of messages, you can assume plural/lots here. %2$s will be replaced by a timespan option. -->
|
||||
<!-- deprecated -->
|
||||
<string name="autodel_server_ask">Do you want to delete %1$d messages now and all newly fetched messages \"%2$s\" in the future?\n\n⚠️ This includes emails, media and \"Saved messages\" in all server folders\n\n⚠️ Do not use this function if you want to keep data on the server or if you use classic email clients as well</string>
|
||||
<!-- shown below enabled autodel_server-option, should be a summary of autodel_server_ask and remind about the impact -->
|
||||
<!-- deprecated -->
|
||||
<string name="autodel_server_enabled_hint">This includes emails, media and \"Saved messages\" in all server folders. Do not use this function if you want to keep data on the server or if you use classic email clients as well</string>
|
||||
<!-- deprecated -->
|
||||
<string name="autodel_server_warn_multi_device_title">Turn on at-once deletion</string>
|
||||
<!-- deprecated -->
|
||||
<string name="autodel_server_warn_multi_device">If you enable at-once deletion you cannot use multiple devices on this profile.</string>
|
||||
<string name="autodel_confirm">I understand, delete all these messages</string>
|
||||
<!-- "At once" in the meaning of "Immediately", without any intervening time. -->
|
||||
@@ -1217,6 +1227,9 @@
|
||||
<string name="perm_enable_bg_reminder_title">Tap here to receive messages while Delta Chat is in the background.</string>
|
||||
<string name="perm_enable_bg_already_done">You already allowed Delta Chat to receive messages in the background.\n\nIf messages still do not arrive in background, please also check your system settings.</string>
|
||||
|
||||
<!-- Accessibility -->
|
||||
<string name="accessibility_link_action">Open %1$s</string>
|
||||
|
||||
<!-- 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>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user