diff --git a/lib/installer-exclude/otr4j.jar b/lib/installer-exclude/otr4j.jar index d85c9dd0d9..ac41d0f59b 100644 Binary files a/lib/installer-exclude/otr4j.jar and b/lib/installer-exclude/otr4j.jar differ diff --git a/src/net/java/sip/communicator/plugin/otr/OtrContactMenu.java b/src/net/java/sip/communicator/plugin/otr/OtrContactMenu.java index f7c389163c..3e0229202b 100644 --- a/src/net/java/sip/communicator/plugin/otr/OtrContactMenu.java +++ b/src/net/java/sip/communicator/plugin/otr/OtrContactMenu.java @@ -173,7 +173,13 @@ else if (ACTION_COMMAND_CB_ENABLE.equals(actionCommand)) OtrActivator.scOtrEngine.getContactPolicy(contact.contact); boolean state = ((JCheckBoxMenuItem) e.getSource()).isSelected(); - policy.setEnableManual(state); + if (state) { + policy.setEnableManual(); + } else { + policy.setAllowV2(false); + policy.setAllowV3(false); + policy.setAllowV4(false); + } OtrActivator.scOtrEngine.setContactPolicy(contact.contact, policy); } diff --git a/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java b/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java index 9844069f33..3db09f9286 100644 --- a/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java +++ b/src/net/java/sip/communicator/plugin/otr/ScOtrEngineImpl.java @@ -43,6 +43,7 @@ import net.java.sip.communicator.service.protocol.Contact; import net.java.sip.communicator.service.protocol.ContactResource; import net.java.sip.communicator.service.protocol.Message; +import net.java.sip.communicator.service.protocol.OperationFailedException; import net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessaging; import net.java.sip.communicator.service.protocol.OperationSetBasicInstantMessagingTransport; import net.java.sip.communicator.service.protocol.ProtocolProviderService; @@ -113,6 +114,17 @@ public ClientProfile getClientProfile(final SessionID sessionID) { this.forgingKey, this.versions, getLocalKeyPair(sessionID).getPublic()); } + @Override + public void publishClientProfilePayload(final byte[] bytes) { + // FIXME TODO + } + + @Override + public byte[] restoreClientProfilePayload() { + // FIXME TODO + return new byte[0]; + } + @Override public OtrPolicy getSessionPolicy(SessionID sessionID) { @@ -121,7 +133,6 @@ public OtrPolicy getSessionPolicy(SessionID sessionID) @Override public void injectMessage(SessionID sessionID, String messageText) - throws OtrException { OtrContact otrContact = getOtrContact(sessionID); Contact contact = otrContact.contact; @@ -175,9 +186,9 @@ public void injectMessage(SessionID sessionID, String messageText) { imOpSet.sendInstantMessage(contact, resource, message); } - catch (OperationFailedException e) + catch (final OperationFailedException e) { - throw new OtrException(e); + throw new IllegalStateException("Failed to send injected message.", e); } } @@ -337,11 +348,11 @@ private SmpProgressDialog acquireSMPProgressDialog(final OtrContact contact) { } @Override - public String getReplyForUnreadableMessage(SessionID sessionID) + public String getReplyForUnreadableMessage(final SessionID sessionID, final String s) { AccountID accountID = OtrActivator.getAccountIDByUID(sessionID.getAccountID()); - + // FIXME Use 's' for OTRv4 error identifier such that we can offer translated error messages. return OtrActivator.resourceService.getI18NString( "plugin.otr.activator.unreadablemsgreply", new String[] {accountID.getDisplayName(), diff --git a/src/net/java/sip/communicator/plugin/otr/authdialog/OtrConfigurationPanel.java b/src/net/java/sip/communicator/plugin/otr/authdialog/OtrConfigurationPanel.java index 3d9baa9297..fe1d549ba0 100644 --- a/src/net/java/sip/communicator/plugin/otr/authdialog/OtrConfigurationPanel.java +++ b/src/net/java/sip/communicator/plugin/otr/authdialog/OtrConfigurationPanel.java @@ -35,7 +35,6 @@ * * @author George Politis */ -// FIXME is this class being used? @SuppressWarnings("serial") public class OtrConfigurationPanel extends TransparentPanel { @@ -301,8 +300,14 @@ public void actionPerformed(ActionEvent e) { OtrPolicy otrPolicy = OtrActivator.scOtrEngine().getGlobalPolicy(); - otrPolicy.setEnableManual(((JCheckBox) e.getSource()) - .isSelected()); + final boolean selected = ((JCheckBox) e.getSource()).isSelected(); + if (selected) { + otrPolicy.setEnableManual(); + } else { + otrPolicy.setAllowV2(false); + otrPolicy.setAllowV3(false); + otrPolicy.setAllowV4(false); + } OtrActivator.scOtrEngine().setGlobalPolicy(otrPolicy);