Tag messages with originating session

This can be used later in order to display trust status of messages, as
well as for potential resending of messages in case of preKey conflicts.
This commit is contained in:
Andreas Straub 2015-06-29 14:25:23 +02:00
parent a58d5e8ce3
commit ab2f85d2e8
2 changed files with 9 additions and 0 deletions

View File

@ -75,6 +75,11 @@ public class XmppAxolotlMessage {
public String getPlaintext() { public String getPlaintext() {
return plaintext; return plaintext;
} }
public AxolotlService.XmppAxolotlSession getSession() {
return session;
}
} }
public XmppAxolotlMessage(Contact contact, Element axolotlMessage) { public XmppAxolotlMessage(Contact contact, Element axolotlMessage) {

View File

@ -660,4 +660,8 @@ public class Message extends AbstractEntity {
public boolean isTrusted() { public boolean isTrusted() {
return this.axolotlSession != null && this.axolotlSession.isTrusted(); return this.axolotlSession != null && this.axolotlSession.isTrusted();
} }
public void setAxolotlSession(AxolotlService.XmppAxolotlSession session) {
this.axolotlSession = session;
}
} }