From cbbf6f439bda76ed6594d0f69ba8f6fbf7cfec8f Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Tue, 27 Jun 2017 22:50:39 +0200 Subject: [PATCH] add publish-options helper class --- .../services/XmppConnectionService.java | 4 ++++ .../conversations/xmpp/pep/PublishOptions.java | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/main/java/eu/siacs/conversations/xmpp/pep/PublishOptions.java diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index 38031d056..cc18e2605 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -2569,6 +2569,10 @@ public class XmppConnectionService extends Service { }); } + public void pushNodeConfiguration(Account account, final String node, final Bundle options, final OnConfigurationPushed callback) { + pushNodeConfiguration(account,account.getJid().toBareJid(),node,options,callback); + } + public void pushNodeConfiguration(Account account, final Jid jid, final String node, final Bundle options, final OnConfigurationPushed callback) { sendIqPacket(account, mIqGenerator.requestPubsubConfiguration(jid,node), new OnIqPacketReceived() { @Override diff --git a/src/main/java/eu/siacs/conversations/xmpp/pep/PublishOptions.java b/src/main/java/eu/siacs/conversations/xmpp/pep/PublishOptions.java new file mode 100644 index 000000000..c3c1896ef --- /dev/null +++ b/src/main/java/eu/siacs/conversations/xmpp/pep/PublishOptions.java @@ -0,0 +1,17 @@ +package eu.siacs.conversations.xmpp.pep; + +import android.os.Bundle; + +public class PublishOptions { + + private PublishOptions() { + + } + + public static Bundle openAccess() { + final Bundle options = new Bundle(); + options.putString("pubsub#access_model","open"); + return options; + } + +}