From e73fbac56fc032e09ecb677deda655431953fc64 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 10 Nov 2023 15:29:26 +0100 Subject: [PATCH] enable 'PEP Native Bookmarks' --- conversations.doap | 7 +++++++ src/main/java/eu/siacs/conversations/Config.java | 3 --- .../conversations/services/XmppConnectionService.java | 4 +++- .../java/eu/siacs/conversations/xmpp/XmppConnection.java | 3 +-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/conversations.doap b/conversations.doap index 46372e796..de770d0ce 100644 --- a/conversations.doap +++ b/conversations.doap @@ -438,6 +438,13 @@ 0.2.1 + + + + complete + 1.1.3 + + diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java index 2299c3adb..13480a82a 100644 --- a/src/main/java/eu/siacs/conversations/Config.java +++ b/src/main/java/eu/siacs/conversations/Config.java @@ -115,9 +115,6 @@ public final class Config { public static final boolean OMEMO_PADDING = false; public static final boolean PUT_AUTH_TAG_INTO_KEY = true; public static final boolean AUTOMATICALLY_COMPLETE_SESSIONS = true; - - public static final boolean USE_BOOKMARKS2 = false; - public static final boolean DISABLE_PROXY_LOOKUP = false; //useful to debug ibb public static final boolean USE_DIRECT_JINGLE_CANDIDATES = true; public static final boolean DISABLE_HTTP_UPLOAD = false; diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 09ceaeffc..77a257403 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -1937,6 +1937,7 @@ public class XmppConnectionService extends Service { if (connection == null) { Log.d(Config.LOGTAG, account.getJid().asBareJid()+": no connection. ignoring bookmark creation"); } else if (connection.getFeatures().bookmarks2()) { + Log.d(Config.LOGTAG,account.getJid().asBareJid() + ": pushing bookmark via Bookmarks 2"); final Element item = mIqGenerator.publishBookmarkItem(bookmark); pushNodeAndEnforcePublishOptions(account, Namespace.BOOKMARKS2, item, bookmark.getJid().asBareJid().toEscapedString(), PublishOptions.persistentWhitelistAccessMaxItems()); } else if (connection.getFeatures().bookmarksConversion()) { @@ -1950,7 +1951,8 @@ public class XmppConnectionService extends Service { account.removeBookmark(bookmark); final XmppConnection connection = account.getXmppConnection(); if (connection.getFeatures().bookmarks2()) { - IqPacket request = mIqGenerator.deleteItem(Namespace.BOOKMARKS2, bookmark.getJid().asBareJid().toEscapedString()); + final IqPacket request = mIqGenerator.deleteItem(Namespace.BOOKMARKS2, bookmark.getJid().asBareJid().toEscapedString()); + Log.d(Config.LOGTAG,account.getJid().asBareJid() + ": removing bookmark via Bookmarks 2"); sendIqPacket(account, request, (a, response) -> { if (response.getType() == IqPacket.TYPE.ERROR) { Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to delete bookmark " + response.getErrorCondition()); diff --git a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java index 348cf3657..7de0de272 100644 --- a/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java +++ b/src/main/java/eu/siacs/conversations/xmpp/XmppConnection.java @@ -2830,8 +2830,7 @@ public class XmppConnection implements Runnable { } public boolean bookmarks2() { - return Config - .USE_BOOKMARKS2 /* || hasDiscoFeature(account.getJid().asBareJid(), Namespace.BOOKMARKS2_COMPAT)*/; + return pepPublishOptions() && hasDiscoFeature(account.getJid().asBareJid(), Namespace.BOOKMARKS2_COMPAT); } public boolean externalServiceDiscovery() {