From 8831961afeda11e9055ff105da3352d3bd0e91e5 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 27 May 2019 11:16:33 +0200 Subject: [PATCH 1/5] Smack 4.3.4 --- resources/releasedocs/changelog.html | 26 ++++++++++++++++++++++++++ version.gradle | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/resources/releasedocs/changelog.html b/resources/releasedocs/changelog.html index 706a4e2c6..e11abe56a 100644 --- a/resources/releasedocs/changelog.html +++ b/resources/releasedocs/changelog.html @@ -141,6 +141,32 @@ hr {
+

4.3.4 -- 2019-05-27

+ +

Bug +

+ + +

Improvement +

+ +

4.3.3 -- 2019-03-14

Bug diff --git a/version.gradle b/version.gradle index 82e39bdf3..e24c93d15 100644 --- a/version.gradle +++ b/version.gradle @@ -1,7 +1,7 @@ allprojects { ext { shortVersion = '4.3.4' - isSnapshot = true + isSnapshot = false // When using dynamic versions for those, do *not* use [1.0, // 2.0), since this will also pull in 2.0-alpha1. Instead use // [1.0, 1.0.99]. From b8ebaf3aa7246f4459659a849ae5b8451e09466e Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 27 May 2019 11:45:54 +0200 Subject: [PATCH 2/5] Smack 4.3.5-SNAPSHOT --- version.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.gradle b/version.gradle index e24c93d15..3acaa256d 100644 --- a/version.gradle +++ b/version.gradle @@ -1,7 +1,7 @@ allprojects { ext { - shortVersion = '4.3.4' - isSnapshot = false + shortVersion = '4.3.5' + isSnapshot = true // When using dynamic versions for those, do *not* use [1.0, // 2.0), since this will also pull in 2.0-alpha1. Instead use // [1.0, 1.0.99]. From 0ad1a0bd4c78264006bb38c70f6d5cece642068b Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Wed, 3 Jul 2019 23:37:51 +0200 Subject: [PATCH 3/5] Add note about BookmarkManager to MUCManager --- .../java/org/jivesoftware/smackx/muc/MultiUserChatManager.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java index 33e36e76b..40e5efd89 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChatManager.java @@ -282,6 +282,9 @@ public final class MultiUserChatManager extends Manager { * Returns a Set of the rooms where the user has joined. The Iterator will contain Strings where each String * represents a room (e.g. room@muc.jabber.org). * + * Note: In order to get a list of bookmarked (but not necessarily joined) conferences, use + * {@link org.jivesoftware.smackx.bookmarks.BookmarkManager#getBookmarkedConferences()}. + * * @return a List of the rooms where the user has joined using a given connection. */ public Set getJoinedRooms() { From 01e0ae230ba28bd5ca0d8c23964f6ec57bf4de4f Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 22 Aug 2019 10:30:46 +0200 Subject: [PATCH 4/5] Deprecate setHostAddressByNameOrIp() and move logic into setHost() in ConnectionConfiguration.Builder. --- .../smack/ConnectionConfiguration.java | 46 ++++++++++--------- .../smack/ConnectionConfigurationTest.java | 6 +-- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java index d14a82d46..77adc4382 100644 --- a/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java +++ b/smack-core/src/main/java/org/jivesoftware/smack/ConnectionConfiguration.java @@ -646,7 +646,7 @@ public abstract class ConnectionConfiguration { /** * Set the Internet address of the host providing the XMPP service. If set, then this will overwrite anything - * set via {@link #setHost(String)}. + * set via {@link #setHost(CharSequence)}. * * @param address the Internet address of the host providing the XMPP service. * @return a reference to this builder. @@ -658,16 +658,29 @@ public abstract class ConnectionConfiguration { } /** - * Set the name of the host providing the XMPP service. Note that this method does only allow DNS names and not - * IP addresses. Use {@link #setHostAddress(InetAddress)} if you want to explicitly set the Internet address of - * the host providing the XMPP service. + * Set the name of the host providing the XMPP service. This method takes DNS names and + * IP addresses. * * @param host the DNS name of the host providing the XMPP service. * @return a reference to this builder. */ - public B setHost(String host) { - DnsName hostDnsName = DnsName.from(host); - return setHost(hostDnsName); + public B setHost(CharSequence host) { + String fqdnOrIpString = host.toString(); + if (InetAddressUtil.isIpAddress(fqdnOrIpString)) { + InetAddress hostInetAddress; + try { + hostInetAddress = InetAddress.getByName(fqdnOrIpString); + } + catch (UnknownHostException e) { + // Should never happen. + throw new AssertionError(e); + } + setHostAddress(hostInetAddress); + } else { + DnsName dnsName = DnsName.from(fqdnOrIpString); + setHost(dnsName); + } + return getThis(); } /** @@ -691,23 +704,12 @@ public abstract class ConnectionConfiguration { * @see #setHost(DnsName) * @see #setHostAddress(InetAddress) * @since 4.3.2 + * @deprecated use {@link #setHost(CharSequence)} instead. */ + @Deprecated + // TODO: Remove in Smack 4.5. public B setHostAddressByNameOrIp(CharSequence fqdnOrIp) { - String fqdnOrIpString = fqdnOrIp.toString(); - if (InetAddressUtil.isIpAddress(fqdnOrIp)) { - InetAddress hostInetAddress; - try { - hostInetAddress = InetAddress.getByName(fqdnOrIpString); - } - catch (UnknownHostException e) { - // Should never happen. - throw new AssertionError(e); - } - setHostAddress(hostInetAddress); - } else { - setHost(fqdnOrIpString); - } - return getThis(); + return setHost(fqdnOrIp); } public B setPort(int port) { diff --git a/smack-core/src/test/java/org/jivesoftware/smack/ConnectionConfigurationTest.java b/smack-core/src/test/java/org/jivesoftware/smack/ConnectionConfigurationTest.java index 6637eae56..163937c07 100644 --- a/smack-core/src/test/java/org/jivesoftware/smack/ConnectionConfigurationTest.java +++ b/smack-core/src/test/java/org/jivesoftware/smack/ConnectionConfigurationTest.java @@ -1,6 +1,6 @@ /** * - * Copyright 2018 Florian Schmaus. + * Copyright 2018-2019 Florian Schmaus. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,7 @@ public class ConnectionConfigurationTest { DummyConnectionConfiguration.Builder builder = newUnitTestBuilder(); final String ip = "192.168.0.1"; - builder.setHostAddressByNameOrIp(ip); + builder.setHost(ip); DummyConnectionConfiguration connectionConfiguration = builder.build(); assertEquals('/' + ip, connectionConfiguration.getHostAddress().toString()); @@ -39,7 +39,7 @@ public class ConnectionConfigurationTest { DummyConnectionConfiguration.Builder builder = newUnitTestBuilder(); final String fqdn = "foo.example.org"; - builder.setHostAddressByNameOrIp(fqdn); + builder.setHost(fqdn); DummyConnectionConfiguration connectionConfiguration = builder.build(); assertEquals(fqdn, connectionConfiguration.getHost().toString()); From d40b16b5a798e795ceb3b6a09dda77ec2f800e58 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 22 Aug 2019 10:50:03 +0200 Subject: [PATCH 5/5] Fix log message format in Roster: s/{}/{0}/ The MessageFormat used by the JUL Logger requires integers between the curly brackets (unlike SLF4J). --- .../src/main/java/org/jivesoftware/smack/roster/Roster.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 73486cd12..04e2dd8e9 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 @@ -1620,7 +1620,7 @@ public final class Roster extends Manager { @Override public void onSuccess(IQ packet) { final XMPPConnection connection = connection(); - LOGGER.log(Level.FINE, "RosterResultListener received {}", packet); + LOGGER.log(Level.FINE, "RosterResultListener received {0}", packet); Collection addedEntries = new ArrayList<>(); Collection updatedEntries = new ArrayList<>(); Collection deletedEntries = new ArrayList<>();