1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-26 00:02:06 +01:00

Fix MucEnterConfiguration.Builder.withPresence(Presence) throw ISE

when presence is of type available. This inverts the logic to fix
this.
This commit is contained in:
Florian Schmaus 2017-01-30 11:59:09 +01:00
parent 85fcb55bd9
commit 187fe37cd7

View file

@ -95,15 +95,16 @@ public final class MucEnterConfiguration {
/** /**
* Set the presence used to join the MUC room. * Set the presence used to join the MUC room.
* <p> * <p>
* 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.
* <p> * <p>
* *
* @param presence * @param presence
* @return a reference to this builder. * @return a reference to this builder.
*/ */
public Builder withPresence(Presence presence) { public Builder withPresence(Presence presence) {
if (presence.getType() == Presence.Type.available) { if (presence.getType() != Presence.Type.available) {
throw new IllegalArgumentException(); throw new IllegalArgumentException("Presence must be of type 'available'");
} }
joinPresence = presence; joinPresence = presence;