Merge remote-tracking branch 'upstream/main'

This commit is contained in:
adbenitez
2024-12-07 14:29:12 +01:00
53 changed files with 118 additions and 41 deletions
@@ -86,7 +86,7 @@ public class DcContext {
public final static int DC_CONNECTIVITY_CONNECTED = 4000;
private static final String CONFIG_ACCOUNT_ENABLED = "ui.enabled";
private static final String CONFIG_MENTION_NOTIF_ENABLED = "ui.notify_mentions";
private static final String CONFIG_MUTE_MENTIONS_IF_MUTED = "ui.mute_mentions_if_muted";
// when using DcAccounts, use DcAccounts.addAccount() instead
public DcContext(String osName, String dbfile) {
@@ -228,11 +228,11 @@ public class DcContext {
}
public boolean isMentionsEnabled() {
return !"0".equals(getConfig(CONFIG_MENTION_NOTIF_ENABLED));
return getConfigInt(CONFIG_MUTE_MENTIONS_IF_MUTED) != 1;
}
public void setMentionsEnabled(boolean enabled) {
setConfigInt(CONFIG_MENTION_NOTIF_ENABLED, enabled? 1 : 0);
setConfigInt(CONFIG_MUTE_MENTIONS_IF_MUTED, enabled? 0 : 1);
}
public String getName() {
@@ -113,7 +113,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
// it is not needed to keep all past update messages, however, when deleted, also the strings should be deleted.
try {
DcContext dcContext = DcHelper.getContext(this);
final String deviceMsgLabel = "update_1_46_0l_android";
final String deviceMsgLabel = "update_1_50_0_android";
if (!dcContext.wasDeviceMsgEverAdded(deviceMsgLabel)) {
DcMsg msg = null;
if (!getIntent().getBooleanExtra(FROM_WELCOME, false)) {
@@ -124,7 +124,7 @@ public class ConversationListActivity extends PassphraseRequiredActionBarActivit
// Util.copy(inputStream, new FileOutputStream(outputFile));
// msg.setFile(outputFile, "image/jpeg");
msg.setText(getString(R.string.update_1_46_android, "https://raw.githubusercontent.com/ArcaneChat/android/refs/heads/main/CHANGELOG.md"));
msg.setText(getString(R.string.update_1_50_android, "https://raw.githubusercontent.com/ArcaneChat/android/refs/heads/main/CHANGELOG.md"));
}
dcContext.addDeviceMsg(deviceMsgLabel, msg);
@@ -220,7 +220,12 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
webView.setNetworkAvailable(internetAccess); // this does not block network but sets `window.navigator.isOnline` in js land
webView.addJavascriptInterface(new InternalJSApi(), "InternalJSApi");
String href = b.getString(EXTRA_HREF, "");
String extraHref = b.getString(EXTRA_HREF, "");
if (TextUtils.isEmpty(extraHref)) {
extraHref = "index.html";
}
String href = baseURL + "/" + extraHref;
String encodedHref = "";
try {
encodedHref = URLEncoder.encode(href, Charsets.UTF_8.name());