From 187fe37cd7cc2ee83a7bcbe3f47faf75b4fa1540 Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Mon, 30 Jan 2017 11:59:09 +0100 Subject: [PATCH] Fix MucEnterConfiguration.Builder.withPresence(Presence) throw ISE when presence is of type available. This inverts the logic to fix this. --- .../org/jivesoftware/smackx/muc/MucEnterConfiguration.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java index 93ba18392..a08604a4f 100644 --- a/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java +++ b/smack-extensions/src/main/java/org/jivesoftware/smackx/muc/MucEnterConfiguration.java @@ -95,15 +95,16 @@ public final class MucEnterConfiguration { /** * Set the presence used to join the MUC room. *

- * The 'to' value of the given presence will be overridden. + * The 'to' value of the given presence will be overridden and the given presence must be of type + * 'available', otherwise an {@link IllegalArgumentException} will be thrown. *

* * @param presence * @return a reference to this builder. */ public Builder withPresence(Presence presence) { - if (presence.getType() == Presence.Type.available) { - throw new IllegalArgumentException(); + if (presence.getType() != Presence.Type.available) { + throw new IllegalArgumentException("Presence must be of type 'available'"); } joinPresence = presence;