aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/services
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2018-04-29 22:33:17 +0200
committerChristian Schneppe <christian@pix-art.de>2018-04-29 22:33:17 +0200
commit82657e7bf6287759bc037b7de68f8901702473e7 (patch)
tree56cf9487dfadc13b339e714c6d89a28309fc5c81 /src/main/java/de/pixart/messenger/services
parent1802b45f41b9a4aa0e1291e05576bdc39964e06d (diff)
fixed caps hash generation for empty form values
Diffstat (limited to 'src/main/java/de/pixart/messenger/services')
-rw-r--r--src/main/java/de/pixart/messenger/services/XmppConnectionService.java25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
index 9fc322646..00baa733a 100644
--- a/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
+++ b/src/main/java/de/pixart/messenger/services/XmppConnectionService.java
@@ -4007,20 +4007,21 @@ public class XmppConnectionService extends Service {
account.inProgressDiscoFetches.add(key);
IqPacket request = new IqPacket(IqPacket.TYPE.GET);
request.setTo(jid);
- String node = presence.getNode();
- Element query = request.query("http://jabber.org/protocol/disco#info");
- if (node != null) {
- query.setAttribute("node", node);
+ final String node = presence.getNode();
+ final String ver = presence.getVer();
+ final Element query = request.query("http://jabber.org/protocol/disco#info");
+ if (node != null && ver != null) {
+ query.setAttribute("node", node + "#" + ver);
}
- Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": making disco request for " + key.second + " to " + jid + "node=" + node);
- sendIqPacket(account, request, (a, discoPacket) -> {
- if (discoPacket.getType() == IqPacket.TYPE.RESULT) {
- ServiceDiscoveryResult disco1 = new ServiceDiscoveryResult(discoPacket);
- if (presence.getVer().equals(disco1.getVer())) {
- databaseBackend.insertDiscoveryResult(disco1);
- injectServiceDiscorveryResult(a.getRoster(), presence.getHash(), presence.getVer(), disco1);
+ Log.d(Config.LOGTAG, account.getJid().asBareJid() + ": making disco request for " + key.second + " to " + jid);
+ sendIqPacket(account, request, (a, response) -> {
+ if (response.getType() == IqPacket.TYPE.RESULT) {
+ ServiceDiscoveryResult discoveryResult = new ServiceDiscoveryResult(response);
+ if (presence.getVer().equals(discoveryResult.getVer())) {
+ databaseBackend.insertDiscoveryResult(discoveryResult);
+ injectServiceDiscorveryResult(a.getRoster(), presence.getHash(), presence.getVer(), discoveryResult);
} else {
- Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": mismatch in caps for contact " + jid + " " + presence.getVer() + " vs " + disco1.getVer());
+ Log.d(Config.LOGTAG, a.getJid().asBareJid() + ": mismatch in caps for contact " + jid + " " + presence.getVer() + " vs " + discoveryResult.getVer());
}
}
a.inProgressDiscoFetches.remove(key);