1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-22 20:12:07 +01:00

Set localNodeVer after currentCapsVersion is set

This commit is contained in:
Florian Schmaus 2015-03-24 12:05:56 +01:00
parent 49c2c35609
commit 164b7c6690

View file

@ -467,11 +467,13 @@ public class EntityCapsManager extends Manager {
DiscoverInfo discoverInfo = new DiscoverInfo(); DiscoverInfo discoverInfo = new DiscoverInfo();
discoverInfo.setType(IQ.Type.result); discoverInfo.setType(IQ.Type.result);
discoverInfo.setNode(getLocalNodeVer());
sdm.addDiscoverInfoTo(discoverInfo); sdm.addDiscoverInfoTo(discoverInfo);
// getLocalNodeVer() will return a result only after currentCapsVersion is set. Therefore
// set it first and then call getLocalNodeVer()
currentCapsVersion = generateVerificationString(discoverInfo); currentCapsVersion = generateVerificationString(discoverInfo);
final String localNodeVer = getLocalNodeVer(); final String localNodeVer = getLocalNodeVer();
discoverInfo.setNode(localNodeVer);
addDiscoverInfoByNode(localNodeVer, discoverInfo); addDiscoverInfoByNode(localNodeVer, discoverInfo);
if (lastLocalCapsVersions.size() > 10) { if (lastLocalCapsVersions.size() > 10) {
CapsVersionAndHash oldCapsVersion = lastLocalCapsVersions.poll(); CapsVersionAndHash oldCapsVersion = lastLocalCapsVersions.poll();