diff --git a/build.gradle b/build.gradle index 7e14f24d7..837ce17ae 100644 --- a/build.gradle +++ b/build.gradle @@ -396,6 +396,12 @@ subprojects { } clirr { + // 2018-08-14: Disabled Clirr because + // - It reports an breaking change in android.jar (seems right, but there is nothing we can do about it) + // - Only the first smack-* projects are correctly checked, + // the other ones have the output of a clirr report from a previous project + // (Look at the clirr reports). + enabled false semver false } } diff --git a/repl b/repl index 889022260..f11456edb 100755 --- a/repl +++ b/repl @@ -3,15 +3,29 @@ set -e set -u set -o pipefail +JDWP=false +JDWP_PORT=8000 -while getopts d OPTION "$@"; do +while getopts djp: OPTION "$@"; do case $OPTION in d) set -x ;; + j) + JDWP=true + ;; + p) + JDWP_PORT=$OPTARG + ;; esac done +EXTRA_JAVA_ARGS=() +if $JDWP; then + EXTRA_JAVA_ARGS+=("-Xdebug") + EXTRA_JAVA_ARGS+=("-Xrunjdwp:server=y,transport=dt_socket,address=${JDWP_PORT},suspend=n") +fi + PROJECT_ROOT=$(dirname "${BASH_SOURCE[0]}") cd "${PROJECT_ROOT}" @@ -27,7 +41,7 @@ GRADLE_CLASSPATH="$(gradle :smack-repl:printClasspath --quiet |\ tail -n1)" echo "Finished, starting REPL" -java \ +java "${EXTRA_JAVA_ARGS[@]}" \ -Dscala.usejavacp=true \ -classpath "${GRADLE_CLASSPATH}" \ ammonite.Main \ diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java b/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java index c2b35110d..2cd0b7c8d 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/ReconnectionManager.java @@ -43,7 +43,10 @@ import org.jivesoftware.smack.util.Async; * * * {@link ReconnectionPolicy#FIXED_DELAY} - The reconnection mechanism will try to reconnect after a fixed delay - * independently from the number of reconnection attempts already performed + * independently from the number of reconnection attempts already performed. + *
+ * Interrupting the reconnection thread will abort the reconnection mechanism. + *
* * @author Francisco Vives * @author Luca Stucchi @@ -163,7 +166,7 @@ public final class ReconnectionManager { private ReconnectionManager(AbstractXMPPConnection connection) { weakRefConnection = new WeakReferencenull
if there was an error, in which the error
+ * reason will be added in form of a HostAddress
to failedAddresses
. Returns a empty list
+ * in case the DNS name exists but has no associated A or AAAA resource records. Otherwise, if the resolution was
+ * successful and there is at least one A or AAAA resource record, then a non-empty list will be returned.
+ * + * Concrete DNS resolver implementations are free to overwrite this, but have to stick to the interface contract. + *
+ * + * @param name the DNS name to lookup + * @param failedAddresses a list with the failed addresses + * @param dnssecMode the selected DNSSEC mode + * @return A list, either empty or non-empty, ornull
+ */
protected Listtrue
if all features are supported by the connection account, false
otherwise
+ * @throws NoResponseException
+ * @throws XMPPErrorException
+ * @throws NotConnectedException
+ * @throws InterruptedException
+ * @since 4.2.2
+ */
+ public boolean accountSupportsFeatures(CharSequence... features)
+ throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
+ return accountSupportsFeatures(Arrays.asList(features));
+ }
+
+ /**
+ * Check if the given collection of features are supported by the connection account. This means that the discovery
+ * information lookup will be performed on the bare JID of the connection managed by this ServiceDiscoveryManager.
+ *
+ * @param features a collection of features
+ * @return true
if all features are supported by the connection account, false
otherwise
+ * @throws NoResponseException
+ * @throws XMPPErrorException
+ * @throws NotConnectedException
+ * @throws InterruptedException
+ * @since 4.2.2
+ */
+ public boolean accountSupportsFeatures(Collection extends CharSequence> features)
+ throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
+ EntityBareJid accountJid = connection().getUser().asEntityBareJid();
+ return supportsFeatures(accountJid, features);
+ }
+
/**
* Queries the remote entity for it's features and returns true if the given feature is found.
*
diff --git a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
index 06b1b6563..e69aed853 100644
--- a/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
+++ b/smack-im/src/main/java/org/jivesoftware/smack/roster/Roster.java
@@ -215,7 +215,7 @@ public final class Roster extends Manager {
* Returns the default subscription processing mode to use when a new Roster is created. The
* subscription processing mode dictates what action Smack will take when subscription
* requests from other users are made. The default subscription mode
- * is {@link SubscriptionMode#accept_all}.
+ * is {@link SubscriptionMode#reject_all}.
*
* @return the default subscription mode to use for new Rosters
*/
@@ -227,7 +227,7 @@ public final class Roster extends Manager {
* Sets the default subscription processing mode to use when a new Roster is created. The
* subscription processing mode dictates what action Smack will take when subscription
* requests from other users are made. The default subscription mode
- * is {@link SubscriptionMode#accept_all}.
+ * is {@link SubscriptionMode#reject_all}.
*
* @param subscriptionMode the default subscription mode to use for new Rosters.
*/
@@ -385,7 +385,7 @@ public final class Roster extends Manager {
/**
* Returns the subscription processing mode, which dictates what action
* Smack will take when subscription requests from other users are made.
- * The default subscription mode is {@link SubscriptionMode#accept_all}.
+ * The default subscription mode is {@link SubscriptionMode#reject_all}.
* * If using the manual mode, a PacketListener should be registered that * listens for Presence packets that have a type of @@ -401,7 +401,7 @@ public final class Roster extends Manager { /** * Sets the subscription processing mode, which dictates what action * Smack will take when subscription requests from other users are made. - * The default subscription mode is {@link SubscriptionMode#accept_all}. + * The default subscription mode is {@link SubscriptionMode#reject_all}. *
* If using the manual mode, a PacketListener should be registered that
* listens for Presence packets that have a type of
@@ -1409,14 +1409,14 @@ public final class Roster extends Manager {
public enum SubscriptionMode {
/**
- * Automatically accept all subscription and unsubscription requests. This is
- * the default mode and is suitable for simple client. More complex client will
+ * Automatically accept all subscription and unsubscription requests.
+ * This is suitable for simple clients. More complex clients will
* likely wish to handle subscription requests manually.
*/
accept_all,
/**
- * Automatically reject all subscription requests.
+ * Automatically reject all subscription requests. This is the default mode.
*/
reject_all,
diff --git a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoStoreTest.java b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoStoreTest.java
index 91dca385b..e79e65c34 100644
--- a/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoStoreTest.java
+++ b/smack-integration-test/src/main/java/org/jivesoftware/smackx/omemo/OmemoStoreTest.java
@@ -22,6 +22,7 @@ import static junit.framework.TestCase.assertNotNull;
import static junit.framework.TestCase.assertNotSame;
import static junit.framework.TestCase.assertNull;
import static junit.framework.TestCase.assertTrue;
+import static org.jivesoftware.smackx.omemo.OmemoIntegrationTestHelper.cleanServerSideTraces;
import static org.jivesoftware.smackx.omemo.OmemoIntegrationTestHelper.deletePath;
import static org.jivesoftware.smackx.omemo.OmemoIntegrationTestHelper.setUpOmemoManager;
@@ -154,6 +155,8 @@ public class OmemoStoreTest extends AbstractOmemoIntegrationTest {
@Override
public void after() {
+ cleanServerSideTraces(alice);
+ cleanServerSideTraces(bob);
alice.shutdown();
bob.shutdown();
}
diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java
index d17582172..dffd0c94b 100644
--- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java
+++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoManager.java
@@ -19,6 +19,7 @@ package org.jivesoftware.smackx.omemo;
import static org.jivesoftware.smackx.omemo.util.OmemoConstants.BODY_OMEMO_HINT;
import static org.jivesoftware.smackx.omemo.util.OmemoConstants.OMEMO;
import static org.jivesoftware.smackx.omemo.util.OmemoConstants.OMEMO_NAMESPACE_V_AXOLOTL;
+import static org.jivesoftware.smackx.omemo.util.OmemoConstants.PEP_NODE_DEVICE_LIST_NOTIFY;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
@@ -132,6 +133,9 @@ public final class OmemoManager extends Manager {
}
});
+ PEPManager.getInstanceFor(connection).addPEPListener(deviceListUpdateListener);
+ ServiceDiscoveryManager.getInstanceFor(connection).addFeature(PEP_NODE_DEVICE_LIST_NOTIFY);
+
service = OmemoService.getInstance();
}
@@ -810,16 +814,23 @@ public final class OmemoManager extends Manager {
Set