use of eu.siacs.conversations.xmpp.stanzas.IqPacket in project Conversations by siacs.
the class IqGenerator method generateSetUnblockRequest.
public IqPacket generateSetUnblockRequest(final Jid jid) {
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
final Element block = iq.addChild("unblock", Namespace.BLOCKING);
block.addChild("item").setAttribute("jid", jid.toBareJid().toString());
return iq;
}
use of eu.siacs.conversations.xmpp.stanzas.IqPacket in project Conversations by siacs.
the class IqGenerator method enablePush.
public IqPacket enablePush(Jid jid, String node, String secret) {
IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
Element enable = packet.addChild("enable", "urn:xmpp:push:0");
enable.setAttribute("jid", jid.toString());
enable.setAttribute("node", node);
Data data = new Data();
data.setFormType("http://jabber.org/protocol/pubsub#publish-options");
data.put("secret", secret);
data.submit();
enable.addChild(data);
return packet;
}
use of eu.siacs.conversations.xmpp.stanzas.IqPacket in project Conversations by siacs.
the class IqGenerator method generateSetPassword.
public IqPacket generateSetPassword(final Account account, final String newPassword) {
final IqPacket packet = new IqPacket(IqPacket.TYPE.SET);
packet.setTo(account.getServer());
final Element query = packet.addChild("query", Namespace.REGISTER);
final Jid jid = account.getJid();
query.addChild("username").setContent(jid.getLocalpart());
query.addChild("password").setContent(newPassword);
return packet;
}
use of eu.siacs.conversations.xmpp.stanzas.IqPacket in project Conversations by siacs.
the class IqGenerator method retrieveBundlesForDevice.
public IqPacket retrieveBundlesForDevice(final Jid to, final int deviceid) {
final IqPacket packet = retrieve(AxolotlService.PEP_BUNDLES + ":" + deviceid, null);
packet.setTo(to);
return packet;
}
use of eu.siacs.conversations.xmpp.stanzas.IqPacket in project Conversations by siacs.
the class XmppConnection method sendEnableCarbons.
private void sendEnableCarbons() {
final IqPacket iq = new IqPacket(IqPacket.TYPE.SET);
iq.addChild("enable", "urn:xmpp:carbons:2");
this.sendIqPacket(iq, new OnIqPacketReceived() {
@Override
public void onIqPacketReceived(final Account account, final IqPacket packet) {
if (!packet.hasChild("error")) {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": successfully enabled carbons");
features.carbonsEnabled = true;
} else {
Log.d(Config.LOGTAG, account.getJid().toBareJid() + ": error enableing carbons " + packet.toString());
}
}
});
}
Aggregations