From eb31479913fdbf3c352c5657ff164a87333f1e6b Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 25 Mar 2021 08:19:53 +0100 Subject: [PATCH 1/3] [muc] Make sendMessage() return a MessageView of the sent message --- .../main/java/org/jivesoftware/smackx/muc/MultiUserChat.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java index aac039264..7e0c0359b 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MultiUserChat.java @@ -57,6 +57,7 @@ import org.jivesoftware.smack.filter.ToMatchesFilter; import org.jivesoftware.smack.packet.IQ; import org.jivesoftware.smack.packet.Message; import org.jivesoftware.smack.packet.MessageBuilder; +import org.jivesoftware.smack.packet.MessageView; import org.jivesoftware.smack.packet.Presence; import org.jivesoftware.smack.packet.Stanza; import org.jivesoftware.smack.util.Objects; @@ -2034,16 +2035,18 @@ public class MultiUserChat { * Sends a Message to the chat room. * * @param messageBuilder the message. + * @return a read-only view of the send message. * @throws NotConnectedException if the XMPP connection is not connected. * @throws InterruptedException if the calling thread was interrupted. */ - public void sendMessage(MessageBuilder messageBuilder) throws NotConnectedException, InterruptedException { + public MessageView sendMessage(MessageBuilder messageBuilder) throws NotConnectedException, InterruptedException { for (MucMessageInterceptor interceptor : messageInterceptors) { interceptor.intercept(messageBuilder, this); } Message message = messageBuilder.to(room).ofType(Message.Type.groupchat).build(); connection.sendStanza(message); + return message; } /** From d07d46bbdc5203d8ebef57ce7611b2b58fa20ef6 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 25 Mar 2021 08:22:12 +0100 Subject: [PATCH 2/3] [chat2] Fix resource unlock condition If the resource of the updated presence is equal to the currently locked resource, then no further action is required. Thanks to Pedro Oliveira for reporting this. Reported-by: Pedro Oliveira --- .../src/main/java/org/jivesoftware/smack/chat2/ChatManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smack/chat2/ChatManager.java b/smack-extensions/src/main/java/org/jivesoftware/smack/chat2/ChatManager.java index e8349b6c6..3238dda04 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smack/chat2/ChatManager.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smack/chat2/ChatManager.java @@ -161,7 +161,7 @@ public final class ChatManager extends Manager { } final EntityFullJid fullFrom = from.asEntityFullJidIfPossible(); - if (!chat.lockedResource.equals(fullFrom)) { + if (chat.lockedResource.equals(fullFrom)) { return; } From 9d64af26b73d4ec94140d1f8fc90cf686310c8d3 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Thu, 25 Mar 2021 09:26:02 +0100 Subject: [PATCH 3/3] Smack 4.4.2 --- resources/releasedocs/changelog.html | 11 +++++++++++ version | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/resources/releasedocs/changelog.html b/resources/releasedocs/changelog.html index 06c247f84..eda807c81 100644 --- a/resources/releasedocs/changelog.html +++ b/resources/releasedocs/changelog.html @@ -141,6 +141,17 @@ hr {
+

4.4.2 -- 2021-03-25

+ +

Bug +

+
    +
  • [SMACK-903] - StaxXmlPullParser.getNamespace() may throws IllegalArgumentException +
  • +
  • [SMACK-904] - XEP-0096 file transfer fails because of a hidden ClastCastException +
  • +
+

4.4.1 -- 2021-03-03

Bug diff --git a/version b/version index 6be5f1e43..1d068c6ec 100644 --- a/version +++ b/version @@ -1 +1 @@ -4.4.2-SNAPSHOT +4.4.2