add publish-options helper class

This commit is contained in:
Daniel Gultsch 2017-06-27 22:50:39 +02:00
parent 90afaab8ed
commit cbbf6f439b
2 changed files with 21 additions and 0 deletions

View File

@ -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

View File

@ -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;
}
}