+ public TextSecureContent decryptMessage(TextSecureEnvelope envelope) {
+ TextSecureCipher cipher = new TextSecureCipher(new TextSecureAddress(username), axolotlStore);
+ try {
+ return cipher.decrypt(envelope);
+ } catch (Exception e) {
+ // TODO handle all exceptions
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ public void handleEndSession(String source) {
+ axolotlStore.deleteAllSessions(source);
+ }
+
+ public interface ReceiveMessageHandler {
+ void handleMessage(TextSecureEnvelope envelope);
+ }
+
+ public void receiveMessages(ReceiveMessageHandler handler) throws IOException {