From 3a83d08ffa0e631e5e51aca028173b89b4edd0d9 Mon Sep 17 00:00:00 2001 From: Damian Minkov Date: Mon, 16 Dec 2013 12:45:07 +0200 Subject: Adds sip account property to force messaging (when server do not add it to allow header). --- .../impl/protocol/sip/SipRegistrarConnection.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java b/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java index f5dcc1e..e928b95 100644 --- a/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java +++ b/src/net/java/sip/communicator/impl/protocol/sip/SipRegistrarConnection.java @@ -118,6 +118,12 @@ public class SipRegistrarConnection private static final int KEEP_ALIVE_INTERVAL_DEFAULT_VALUE = 25; /** + * An account property to force messaging even if MESSAGE method is not + * listed in AllowHeader. + */ + private static final String FORCE_MESSAGING_PROP = "FORCE_MESSAGING"; + + /** * Specifies whether or not we should be using a route header in register * requests. This field is specified by the REGISTERS_USE_ROUTE account * property. @@ -797,9 +803,13 @@ public class SipRegistrarConnection //Emil XXX: I am not sure how this would work out with most providers //so we are going to only start by implementing this feature for IM. - if ( !set.contains(Request.MESSAGE) ) + if ( !set.contains(Request.MESSAGE) + && !sipProvider.getAccountID() + .getAccountPropertyBoolean(FORCE_MESSAGING_PROP, false)) + { sipProvider.removeSupportedOperationSet( OperationSetBasicInstantMessaging.class); + } } /** -- cgit v1.1