aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations/generator
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2014-06-24 16:14:18 +0200
committeriNPUTmice <daniel@gultsch.de>2014-06-24 16:14:18 +0200
commitea261c1032eae6c17244da029e1c491ade51e1e1 (patch)
tree7a239d39553bc12f9f577b870f9158dfaf1ab464 /src/eu/siacs/conversations/generator
parentc2ddfded94b71e1f04466821378ca4b187292baf (diff)
more otr fixes
Diffstat (limited to 'src/eu/siacs/conversations/generator')
-rw-r--r--src/eu/siacs/conversations/generator/MessageGenerator.java14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/eu/siacs/conversations/generator/MessageGenerator.java b/src/eu/siacs/conversations/generator/MessageGenerator.java
index 77ac55f1..b9728952 100644
--- a/src/eu/siacs/conversations/generator/MessageGenerator.java
+++ b/src/eu/siacs/conversations/generator/MessageGenerator.java
@@ -46,17 +46,21 @@ public class MessageGenerator {
return generateOtrChat(message, false);
}
- public MessagePacket generateOtrChat(Message message, boolean addDelay) throws OtrException {
+ public MessagePacket generateOtrChat(Message message, boolean addDelay) {
Session otrSession = message.getConversation().getOtrSession();
if (otrSession==null) {
- throw new OtrException(null);
+ return null;
}
MessagePacket packet = preparePacket(message,addDelay);
packet.addChild("private", "urn:xmpp:carbons:2");
packet.addChild("no-copy", "urn:xmpp:hints");
- packet.setBody(otrSession.transformSending(message
- .getBody()));
- return packet;
+ try {
+ packet.setBody(otrSession.transformSending(message
+ .getBody()));
+ return packet;
+ } catch (OtrException e) {
+ return null;
+ }
}
public MessagePacket generateChat(Message message) {