From feeece405d47ed019b125b5fadf8a1f95c4caa46 Mon Sep 17 00:00:00 2001 From: adbenitez Date: Fri, 29 May 2026 02:15:06 +0200 Subject: [PATCH] fix WebxdcActivity --- .../delta/rpc/types/WebxdcMessageInfo.java | 2 ++ .../securesms/WebxdcActivity.java | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/main/java/chat/delta/rpc/types/WebxdcMessageInfo.java b/src/main/java/chat/delta/rpc/types/WebxdcMessageInfo.java index 3efcda8f6..fa4deb0a9 100644 --- a/src/main/java/chat/delta/rpc/types/WebxdcMessageInfo.java +++ b/src/main/java/chat/delta/rpc/types/WebxdcMessageInfo.java @@ -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; diff --git a/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java b/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java index dcff76624..e242927ee 100644 --- a/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java +++ b/src/main/java/org/thoughtcrime/securesms/WebxdcActivity.java @@ -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;