aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2016-11-20 17:32:24 +0100
committerChristian Schneppe <christian@pix-art.de>2016-11-20 17:32:24 +0100
commit7d72a6bcf10f3c52af1f9a453225e04d7e209350 (patch)
tree98ed2e5406b18e16675118cfbbc66a6b6fe1a381 /src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
parent80b71f7f462faef91fca628aabe0f6d5c20e0b90 (diff)
save last activation time in fingerprint status
Diffstat (limited to '')
-rw-r--r--src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
index 13c80ef96..8c9b5a7bb 100644
--- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
+++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java
@@ -25,7 +25,10 @@ import java.security.PrivateKey;
import java.security.Security;
import java.security.Signature;
import java.security.cert.X509Certificate;
+import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -296,14 +299,18 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
return new AxolotlAddress(jid.toPreppedString(), 0);
}
- public Set<XmppAxolotlSession> findOwnSessions() {
+ public Collection<XmppAxolotlSession> findOwnSessions() {
AxolotlAddress ownAddress = getAddressForJid(account.getJid().toBareJid());
- return new HashSet<>(this.sessions.getAll(ownAddress).values());
+ ArrayList<XmppAxolotlSession> s = new ArrayList<>(this.sessions.getAll(ownAddress).values());
+ Collections.sort(s);
+ return s;
}
- public Set<XmppAxolotlSession> findSessionsForContact(Contact contact) {
+ public Collection<XmppAxolotlSession> findSessionsForContact(Contact contact) {
AxolotlAddress contactAddress = getAddressForJid(contact.getJid());
- return new HashSet<>(this.sessions.getAll(contactAddress).values());
+ ArrayList<XmppAxolotlSession> s = new ArrayList<>(this.sessions.getAll(contactAddress).values());
+ Collections.sort(s);
+ return s;
}
private Set<XmppAxolotlSession> findSessionsForConversation(Conversation conversation) {
@@ -929,7 +936,7 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
account.getJid().toBareJid(), getOwnDeviceId());
Set<XmppAxolotlSession> remoteSessions = findSessionsForConversation(conversation);
- Set<XmppAxolotlSession> ownSessions = findOwnSessions();
+ Collection<XmppAxolotlSession> ownSessions = findOwnSessions();
if (remoteSessions.isEmpty()) {
return null;
}