Merge remote-tracking branch 'upstream/main'

This commit is contained in:
adbenitez
2026-06-29 20:26:34 +02:00
5 changed files with 34 additions and 16 deletions
+2
View File
@@ -6,6 +6,8 @@
* Add notifications for missed calls
* Video call preview now accurately shows what is sent to remote
* Fix: properly hide draft attachment during in-chat search
* Fix: close mini-apps and chats if they are deleted
* Fix: cancel in-chat search when back is pressed, instead of directly returning to chatlist
## v2.53.0
2026-06
@@ -264,6 +264,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
public void handleOnBackPressed() {
if (container.isInputOpen()) {
container.hideCurrentInput(composeText);
} else if (searchMenu != null) {
searchCollapse();
} else {
handleReturnToConversationList();
}
@@ -280,6 +282,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
eventCenter.removeObservers(this);
eventCenter.addMultiAccountObserver(DcContext.DC_EVENT_CHAT_MODIFIED, this);
eventCenter.addMultiAccountObserver(DcContext.DC_EVENT_CHAT_DELETED, this);
eventCenter.addMultiAccountObserver(DcContext.DC_EVENT_CHAT_EPHEMERAL_TIMER_MODIFIED, this);
eventCenter.addMultiAccountObserver(DcContext.DC_EVENT_CONTACTS_CHANGED, this);
@@ -1882,6 +1885,8 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
&& event.getData1Int() == chatId) {
dcChat = dcContext.getChat(chatId);
titleView.setTitle(glideRequests, dcChat);
} else if (eventId == DcContext.DC_EVENT_CHAT_DELETED && event.getData1Int() == chatId) {
finish();
}
}
@@ -61,6 +61,7 @@ import org.thoughtcrime.securesms.util.Util;
public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcEventDelegate {
private static final String TAG = "WebxdcActivity";
private static final String EXTRA_ACCOUNT_ID = "accountId";
private static final String EXTRA_CHAT_ID = "chatId";
private static final String EXTRA_APP_MSG_ID = "appMessageId";
private static final String EXTRA_HIDE_ACTION_BAR = "hideActionBar";
private static final String EXTRA_HREF = "href";
@@ -71,6 +72,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
private DcContext dcContext;
private int accountId;
private Rpc rpc;
private int chatId;
private DcMsg dcAppMsg;
private String baseURL;
private String sourceCodeUrl = "";
@@ -112,7 +114,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
}
dcContext.setConfigInt("ui.maps_version", mapsVersion);
}
openWebxdcActivity(context, msgId, true, href);
openWebxdcActivity(context, msgId, chatId, true, href);
}
public static void openWebxdcActivity(Context context, DcMsg instance) {
@@ -120,18 +122,18 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
}
public static void openWebxdcActivity(Context context, @NonNull DcMsg instance, String href) {
openWebxdcActivity(context, instance.getId(), false, href);
openWebxdcActivity(context, instance.getId(), instance.getChatId(), false, href);
}
public static void openWebxdcActivity(
Context context, int msgId, boolean hideActionBar, String href) {
Context context, int msgId, int chatId, boolean hideActionBar, String href) {
if (!Util.isClickedRecently()) {
context.startActivity(getWebxdcIntent(context, msgId, hideActionBar, href));
context.startActivity(getWebxdcIntent(context, msgId, chatId, hideActionBar, href));
}
}
private static Intent getWebxdcIntent(
Context context, int msgId, boolean hideActionBar, String href) {
Context context, int msgId, int chatId, boolean hideActionBar, String href) {
DcContext dcContext = DcHelper.getContext(context);
int accountId = dcContext.getAccountId();
Intent intent = new Intent(context, WebxdcActivity.class);
@@ -139,6 +141,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
// Unique URI per webxdc instance so FLAG_ACTIVITY_NEW_DOCUMENT can identify the document:
intent.setData(Uri.parse("webxdc://" + accountId + "/" + msgId));
intent.putExtra(EXTRA_ACCOUNT_ID, accountId);
intent.putExtra(EXTRA_CHAT_ID, chatId);
intent.putExtra(EXTRA_APP_MSG_ID, msgId);
intent.putExtra(EXTRA_HIDE_ACTION_BAR, hideActionBar);
intent.putExtra(EXTRA_HREF, href);
@@ -149,12 +152,13 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
private static Intent[] getWebxdcIntentWithParentStack(Context context, int msgId) {
DcContext dcContext = DcHelper.getContext(context);
int chatId = dcContext.getMsg(msgId).getChatId();
final Intent chatIntent =
new Intent(context, ConversationActivity.class)
.putExtra(ConversationActivity.CHAT_ID_EXTRA, dcContext.getMsg(msgId).getChatId())
.putExtra(ConversationActivity.CHAT_ID_EXTRA, chatId)
.setAction(Intent.ACTION_VIEW);
final Intent webxdcIntent = getWebxdcIntent(context, msgId, false, "");
final Intent webxdcIntent = getWebxdcIntent(context, msgId, chatId, false, "");
return TaskStackBuilder.create(context)
.addNextIntentWithParentStack(chatIntent)
@@ -200,12 +204,6 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
}
});
DcEventCenter eventCenter =
DcHelper.getEventCenter(WebxdcActivity.this.getApplicationContext());
eventCenter.addMultiAccountObserver(DcContext.DC_EVENT_WEBXDC_STATUS_UPDATE, this);
eventCenter.addMultiAccountObserver(DcContext.DC_EVENT_MSGS_CHANGED, this);
eventCenter.addMultiAccountObserver(DcContext.DC_EVENT_WEBXDC_REALTIME_DATA, this);
int appMessageId = b.getInt(EXTRA_APP_MSG_ID);
accountId = b.getInt(EXTRA_ACCOUNT_ID);
this.dcContext = DcHelper.getContext(getApplicationContext());
@@ -219,6 +217,15 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
finish();
return;
}
chatId = b.getInt(EXTRA_CHAT_ID, dcAppMsg.getChatId());
DcEventCenter eventCenter =
DcHelper.getEventCenter(WebxdcActivity.this.getApplicationContext());
eventCenter.addObserver(DcContext.DC_EVENT_WEBXDC_STATUS_UPDATE, this);
eventCenter.addObserver(DcContext.DC_EVENT_MSGS_CHANGED, this);
eventCenter.addObserver(DcContext.DC_EVENT_MSG_DELETED, this);
eventCenter.addObserver(DcContext.DC_EVENT_CHAT_DELETED, this);
eventCenter.addObserver(DcContext.DC_EVENT_WEBXDC_REALTIME_DATA, this);
// `msg_id` in the subdomain makes sure, different apps using same files do not share the same
// cache entry
@@ -515,6 +522,10 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
Log.e(TAG, "RPC Error", e);
}
});
} else if ((eventId == DcContext.DC_EVENT_MSG_DELETED
&& event.getData2Int() == dcAppMsg.getId())
|| (eventId == DcContext.DC_EVENT_CHAT_DELETED && event.getData1Int() == chatId)) {
finish();
}
}
@@ -563,7 +574,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
IconCompat.createWithBitmap(
bitmap)) // createWithAdaptiveBitmap() removes decorations but cuts out a too
// small circle and defamiliarize the icon too much
.setIntent(getWebxdcIntent(context, msgId, false, ""))
.setIntent(getWebxdcIntent(context, msgId, msg.getChatId(), false, ""))
.build();
Toast.makeText(context, R.string.one_moment, Toast.LENGTH_SHORT).show();
@@ -725,7 +725,7 @@ public class NotificationCenter {
NotificationCompat.Action markAsReadAction =
new NotificationCompat.Action(
R.drawable.check, context.getString(R.string.mark_as_read_short), markReadIntent);
R.drawable.check, context.getString(R.string.mark_as_read), markReadIntent);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
NotificationCompat.Action replyAction =
+1 -1
View File
@@ -73,7 +73,7 @@
<!-- Used as an menu entry or button -->
<string name="mark_as_read">Mark as Read</string>
<!-- Used beside an icon with very few space. Shortest text for "Mark as being read". In english, this could be "Read" (past tense of "to read"), in german, this could be "Gelesen". -->
<string name="mark_as_read_short">Mark Read</string>
<string name="mark_as_read_short">Read</string>
<!-- Used as an menu entry or button -->
<string name="mark_as_unread">Mark as Unread</string>
<!-- Used beside an icon with very few space. Shortest text for "Mark as being unread". In english, this could be "Unread" (past tense of "to unread"), in german, this could be "Ungelesen". -->