diff options
author | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 17:53:03 +0200 |
---|---|---|
committer | Christian Schneppe <christian.schneppe@pix-art.de> | 2019-10-26 17:53:03 +0200 |
commit | 8d7727fcdc400dcd05babe4ec9b78fa0d1f56717 (patch) | |
tree | 45472c1966b93fe5febffa068710fcd3a8da8af2 /src/main/java/de/pixart/messenger/generator/IqGenerator.java | |
parent | 6df9c91b30c01beeb5d3f25d68f599e0dbe4c319 (diff) |
support for delete bookmarks2
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/IqGenerator.java | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/main/java/de/pixart/messenger/generator/IqGenerator.java b/src/main/java/de/pixart/messenger/generator/IqGenerator.java index 812ffcb9e..bb6355688 100644 --- a/src/main/java/de/pixart/messenger/generator/IqGenerator.java +++ b/src/main/java/de/pixart/messenger/generator/IqGenerator.java @@ -58,12 +58,6 @@ public class IqGenerator extends AbstractGenerator { return packet; } - public IqPacket purgeOfflineMessages() { - final IqPacket packet = new IqPacket(IqPacket.TYPE.SET); - packet.addChild("offline", Namespace.FLEXIBLE_OFFLINE_MESSAGE_RETRIEVAL).addChild("purge"); - return packet; - } - public IqPacket versionResponse(final IqPacket request) { final IqPacket packet = request.generateResponse(IqPacket.TYPE.RESULT); Element query = packet.query("jabber:iq:version"); @@ -97,6 +91,12 @@ public class IqGenerator extends AbstractGenerator { return packet; } + public IqPacket purgeOfflineMessages() { + final IqPacket packet = new IqPacket(IqPacket.TYPE.SET); + packet.addChild("offline", Namespace.FLEXIBLE_OFFLINE_MESSAGE_RETRIEVAL).addChild("purge"); + return packet; + } + protected IqPacket publish(final String node, final Element item, final Bundle options) { final IqPacket packet = new IqPacket(IqPacket.TYPE.SET); final Element pubsub = packet.addChild("pubsub", Namespace.PUBSUB); @@ -142,6 +142,15 @@ public class IqGenerator extends AbstractGenerator { return packet; } + public IqPacket deleteItem(final String node, final String id) { + IqPacket packet = new IqPacket(IqPacket.TYPE.SET); + final Element pubsub = packet.addChild("pubsub", Namespace.PUBSUB); + final Element retract = pubsub.addChild("retract"); + retract.setAttribute("node", node); + retract.addChild("item").setAttribute("id", id); + return packet; + } + public IqPacket publishAvatar(Avatar avatar, Bundle options) { final Element item = new Element("item"); item.setAttribute("id", avatar.sha1sum); @@ -565,4 +574,4 @@ public class IqGenerator extends AbstractGenerator { } return packet; } -} +}
\ No newline at end of file |