aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/parser
diff options
context:
space:
mode:
authorStephen Paul Weber <singpolyma@singpolyma.net>2016-01-17 16:46:32 -0500
committerStephen Paul Weber <singpolyma@singpolyma.net>2016-01-24 17:46:08 -0500
commit000f59d614d07ac573c1159ea964ebfee6ecbef5 (patch)
tree8357d260780d9ccc8a4bef7b37ebc72681d51d8b /src/main/java/eu/siacs/conversations/parser
parentbf5b2f73f5a61f0a0179c9d4431579f87eecb001 (diff)
Fetch cached caps result on new presence
Diffstat (limited to 'src/main/java/eu/siacs/conversations/parser')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/PresenceParser.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
index 46c8a35d..88631a91 100644
--- a/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/PresenceParser.java
@@ -9,8 +9,8 @@ import eu.siacs.conversations.entities.Contact;
import eu.siacs.conversations.entities.Conversation;
import eu.siacs.conversations.entities.Message;
import eu.siacs.conversations.entities.MucOptions;
-import eu.siacs.conversations.entities.Presences;
import eu.siacs.conversations.entities.Presence;
+import eu.siacs.conversations.entities.ServiceDiscoveryResult;
import eu.siacs.conversations.generator.PresenceGenerator;
import eu.siacs.conversations.services.XmppConnectionService;
import eu.siacs.conversations.xml.Element;
@@ -177,7 +177,15 @@ public class PresenceParser extends AbstractParser implements
}
}
int sizeBefore = contact.getPresences().size();
- contact.updatePresence(presence, new Presence(packet.findChild("show")));
+
+ ServiceDiscoveryResult disco = null;
+ Element caps = packet.findChild("c", "http://jabber.org/protocol/caps");
+ if (caps != null) {
+ disco = mXmppConnectionService.databaseBackend.
+ findDiscoveryResult(caps.getAttribute("hash"), caps.getAttribute("ver"));
+ }
+ contact.updatePresence(presence, new Presence(packet.findChild("show"), disco));
+
PgpEngine pgp = mXmppConnectionService.getPgpEngine();
Element x = packet.findChild("x", "jabber:x:signed");
if (pgp != null && x != null) {