aboutsummaryrefslogtreecommitdiffstats
path: root/src/net/java/sip/communicator/util
diff options
context:
space:
mode:
authorDamian Minkov <damencho@jitsi.org>2013-05-08 10:48:03 +0300
committerDamian Minkov <damencho@jitsi.org>2013-05-08 10:48:03 +0300
commita9c65e9cd3b508baa050db62a86b018fd981ea3e (patch)
tree40016751e5a480d55c67971d9836e4ad8c81d1ad /src/net/java/sip/communicator/util
parentcd5a0b7bc0f29c100e0f724facbad75c6521bffc (diff)
downloadjitsi-a9c65e9cd3b508baa050db62a86b018fd981ea3e.zip
jitsi-a9c65e9cd3b508baa050db62a86b018fd981ea3e.tar.gz
jitsi-a9c65e9cd3b508baa050db62a86b018fd981ea3e.tar.bz2
Adds additional utility methods.
Diffstat (limited to 'src/net/java/sip/communicator/util')
-rw-r--r--src/net/java/sip/communicator/util/call/MetaContactPhoneUtil.java43
1 files changed, 39 insertions, 4 deletions
diff --git a/src/net/java/sip/communicator/util/call/MetaContactPhoneUtil.java b/src/net/java/sip/communicator/util/call/MetaContactPhoneUtil.java
index 11bbd09..5cd11ec 100644
--- a/src/net/java/sip/communicator/util/call/MetaContactPhoneUtil.java
+++ b/src/net/java/sip/communicator/util/call/MetaContactPhoneUtil.java
@@ -301,15 +301,36 @@ public class MetaContactPhoneUtil
*/
public boolean isCallEnabled(DetailsResponseListener listener)
{
+ return isCallEnabled(listener, true);
+ }
+
+ /**
+ * Is call enabled for metaContact. If any of the child
+ * contacts has call enabled.
+ * @param listener the <tt>DetailsResponseListener</tt> to listen for result
+ * details
+ * @param checkForTelephonyOpSet whether we should check for registered
+ * telephony operation sets that can be used to dial out, can be used
+ * in plugins dialing out using methods outside the provider.
+ * @return is call enabled for metaContact.
+ */
+ public boolean isCallEnabled(DetailsResponseListener listener,
+ boolean checkForTelephonyOpSet)
+ {
// make sure children are checked
if(!checkMetaContactPhones(listener))
return false;
+ boolean hasPhoneCheck = hasPhones;
+
+ if(checkForTelephonyOpSet)
+ hasPhoneCheck =
+ hasPhones && AccountUtils.getRegisteredProviders(
+ OperationSetBasicTelephony.class).size() > 0;
+
return metaContact.getDefaultContact(
OperationSetBasicTelephony.class) != null
- || (hasPhones
- && AccountUtils.getRegisteredProviders(
- OperationSetBasicTelephony.class).size() > 0);
+ || hasPhoneCheck;
}
/**
@@ -319,7 +340,21 @@ public class MetaContactPhoneUtil
*/
public boolean isCallEnabled()
{
- return isCallEnabled((DetailsResponseListener) null);
+ return isCallEnabled(null, true);
+ }
+
+ /**
+ * Is call enabled for metaContact. If any of the child
+ * contacts has call enabled.
+ * @param checkForTelephonyOpSet whether we should check for registered
+ * telephony operation sets that can be used to dial out, can be used
+ * in plugins dialing out using methods outside the provider.
+ * @return is call enabled for metaContact.
+ */
+ public boolean isCallEnabled(boolean checkForTelephonyOpSet)
+ {
+ return isCallEnabled(null,
+ checkForTelephonyOpSet);
}
/**