1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 18:48:00 +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.setType(IQ.Type.result);
discoverInfo.setNode(getLocalNodeVer());
sdm.addDiscoverInfoTo(discoverInfo);
// getLocalNodeVer() will return a result only after currentCapsVersion is set. Therefore
// set it first and then call getLocalNodeVer()
currentCapsVersion = generateVerificationString(discoverInfo);
final String localNodeVer = getLocalNodeVer();
discoverInfo.setNode(localNodeVer);
addDiscoverInfoByNode(localNodeVer, discoverInfo);
if (lastLocalCapsVersions.size() > 10) {
CapsVersionAndHash oldCapsVersion = lastLocalCapsVersions.poll();