enable 'PEP Native Bookmarks'

This commit is contained in:
Daniel Gultsch 2023-11-10 15:29:26 +01:00
parent f798102978
commit e73fbac56f
No known key found for this signature in database
GPG key ID: F43D18AD2A0982C2
4 changed files with 11 additions and 6 deletions

View file

@ -438,6 +438,13 @@
<xmpp:version>0.2.1</xmpp:version> <xmpp:version>0.2.1</xmpp:version>
</xmpp:SupportedXep> </xmpp:SupportedXep>
</implements> </implements>
<implements>
<xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0402.html"/>
<xmpp:status>complete</xmpp:status>
<xmpp:version>1.1.3</xmpp:version>
</xmpp:SupportedXep>
</implements>
<implements> <implements>
<xmpp:SupportedXep> <xmpp:SupportedXep>
<xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0410.html"/> <xmpp:xep rdf:resource="https://xmpp.org/extensions/xep-0410.html"/>

View file

@ -115,9 +115,6 @@ public final class Config {
public static final boolean OMEMO_PADDING = false; public static final boolean OMEMO_PADDING = false;
public static final boolean PUT_AUTH_TAG_INTO_KEY = true; public static final boolean PUT_AUTH_TAG_INTO_KEY = true;
public static final boolean AUTOMATICALLY_COMPLETE_SESSIONS = 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 DISABLE_PROXY_LOOKUP = false; //useful to debug ibb
public static final boolean USE_DIRECT_JINGLE_CANDIDATES = true; public static final boolean USE_DIRECT_JINGLE_CANDIDATES = true;
public static final boolean DISABLE_HTTP_UPLOAD = false; public static final boolean DISABLE_HTTP_UPLOAD = false;

View file

@ -1937,6 +1937,7 @@ public class XmppConnectionService extends Service {
if (connection == null) { if (connection == null) {
Log.d(Config.LOGTAG, account.getJid().asBareJid()+": no connection. ignoring bookmark creation"); Log.d(Config.LOGTAG, account.getJid().asBareJid()+": no connection. ignoring bookmark creation");
} else if (connection.getFeatures().bookmarks2()) { } else if (connection.getFeatures().bookmarks2()) {
Log.d(Config.LOGTAG,account.getJid().asBareJid() + ": pushing bookmark via Bookmarks 2");
final Element item = mIqGenerator.publishBookmarkItem(bookmark); final Element item = mIqGenerator.publishBookmarkItem(bookmark);
pushNodeAndEnforcePublishOptions(account, Namespace.BOOKMARKS2, item, bookmark.getJid().asBareJid().toEscapedString(), PublishOptions.persistentWhitelistAccessMaxItems()); pushNodeAndEnforcePublishOptions(account, Namespace.BOOKMARKS2, item, bookmark.getJid().asBareJid().toEscapedString(), PublishOptions.persistentWhitelistAccessMaxItems());
} else if (connection.getFeatures().bookmarksConversion()) { } else if (connection.getFeatures().bookmarksConversion()) {
@ -1950,7 +1951,8 @@ public class XmppConnectionService extends Service {
account.removeBookmark(bookmark); account.removeBookmark(bookmark);
final XmppConnection connection = account.getXmppConnection(); final XmppConnection connection = account.getXmppConnection();
if (connection.getFeatures().bookmarks2()) { 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) -> { sendIqPacket(account, request, (a, response) -> {
if (response.getType() == IqPacket.TYPE.ERROR) { if (response.getType() == IqPacket.TYPE.ERROR) {
Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to delete bookmark " + response.getErrorCondition()); Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": unable to delete bookmark " + response.getErrorCondition());

View file

@ -2830,8 +2830,7 @@ public class XmppConnection implements Runnable {
} }
public boolean bookmarks2() { public boolean bookmarks2() {
return Config return pepPublishOptions() && hasDiscoFeature(account.getJid().asBareJid(), Namespace.BOOKMARKS2_COMPAT);
.USE_BOOKMARKS2 /* || hasDiscoFeature(account.getJid().asBareJid(), Namespace.BOOKMARKS2_COMPAT)*/;
} }
public boolean externalServiceDiscovery() { public boolean externalServiceDiscovery() {