Handle end session messages

This commit is contained in:
AsamK 2015-07-07 12:19:10 +02:00
parent 01702276c5
commit 1b0df2c7e7
3 changed files with 10 additions and 7 deletions

View file

@ -188,9 +188,11 @@ public class Main {
} else {
if (content.getDataMessage().isPresent()) {
TextSecureDataMessage message = content.getDataMessage().get();
System.out.println("Body: " + message.getBody().get());
if (message.getAttachments().isPresent()) {
if (message.isEndSession()) {
m.handleEndSession(envelope.getSource());
} else if (message.getAttachments().isPresent()) {
System.out.println("Attachments: ");
for (TextSecureAttachment attachment : message.getAttachments().get()) {
System.out.println("- " + attachment.getContentType() + " (" + (attachment.isPointer() ? "Pointer" : "") + (attachment.isStream() ? "Stream" : "") + ")");