fix WebxdcActivity

This commit is contained in:
adbenitez
2026-05-29 02:15:06 +02:00
parent 20459a5710
commit feeece405d
2 changed files with 12 additions and 9 deletions
@@ -2,6 +2,8 @@
package chat.delta.rpc.types;
public class WebxdcMessageInfo {
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String orientation;
/** if the Webxdc represents a document, then this is the name of the document */
@com.fasterxml.jackson.annotation.JsonSetter(nulls = com.fasterxml.jackson.annotation.Nulls.SET)
public String document;
@@ -225,18 +225,19 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
// also a random-id is not that useful for debugging)
this.baseURL = "https://acc" + accountId + "-msg" + appMessageId + ".localhost";
if ("landscape".equals(JsonUtils.optString(this.dcAppMsg.getWebxdcInfo(), "orientation"))) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
// enter fullscreen mode if necessary,
// this is needed here because if the app is opened while already in landscape mode,
// onConfigurationChanged() is not triggered
setScreenMode(getResources().getConfiguration());
}
WebxdcMessageInfo info;
try {
info = rpc.getWebxdcInfo(accountId, appMessageId);
if ("landscape".equals(info.orientation)) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
} else {
// enter fullscreen mode if necessary,
// this is needed here because if the app is opened while already in landscape mode,
// onConfigurationChanged() is not triggered
setScreenMode(getResources().getConfiguration());
}
internetAccess = info.internetAccess;
selfAddr = info.selfAddr;
isAppSender = info.isAppSender;