diff options
author | Christian Schneppe <christian@pix-art.de> | 2018-08-26 14:56:43 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2018-08-26 14:56:43 +0200 |
commit | 7983e7e03f228d4805c53082545dd8c278275fa1 (patch) | |
tree | e583c9cd593189947435747e051beb8e76e1046a /src/main/java/de/pixart/messenger/generator/IqGenerator.java | |
parent | 2ae0ecec3a947776be2355b1fbfc9b0334b59fc3 (diff) |
add id="current" on every published PEP item
This makes sure even misconfigured PEP nodes still get only one item, as
defined in XEP-0060 ยง12.20.
Diffstat (limited to '')
-rw-r--r-- | src/main/java/de/pixart/messenger/generator/IqGenerator.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/de/pixart/messenger/generator/IqGenerator.java b/src/main/java/de/pixart/messenger/generator/IqGenerator.java index 99ed905f4..86f58af69 100644 --- a/src/main/java/de/pixart/messenger/generator/IqGenerator.java +++ b/src/main/java/de/pixart/messenger/generator/IqGenerator.java @@ -204,6 +204,7 @@ public class IqGenerator extends AbstractGenerator { public IqPacket publishDeviceIds(final Set<Integer> ids, final Bundle publishOptions) { final Element item = new Element("item"); + item.setAttribute("id", "current"); final Element list = item.addChild("list", AxolotlService.PEP_PREFIX); for (Integer id : ids) { final Element device = new Element("device"); @@ -216,6 +217,7 @@ public class IqGenerator extends AbstractGenerator { public IqPacket publishBundles(final SignedPreKeyRecord signedPreKeyRecord, final IdentityKey identityKey, final Set<PreKeyRecord> preKeyRecords, final int deviceId, Bundle publishOptions) { final Element item = new Element("item"); + item.setAttribute("id", "current"); final Element bundle = item.addChild("bundle", AxolotlService.PEP_PREFIX); final Element signedPreKeyPublic = bundle.addChild("signedPreKeyPublic"); signedPreKeyPublic.setAttribute("signedPreKeyId", signedPreKeyRecord.getId()); @@ -238,6 +240,7 @@ public class IqGenerator extends AbstractGenerator { public IqPacket publishVerification(byte[] signature, X509Certificate[] certificates, final int deviceId) { final Element item = new Element("item"); + item.setAttribute("id", "current"); final Element verification = item.addChild("verification", AxolotlService.PEP_PREFIX); final Element chain = verification.addChild("chain"); for (int i = 0; i < certificates.length; ++i) { |