1
0
Fork 0
mirror of https://codeberg.org/Mercury-IM/Smack synced 2024-11-25 15:52: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.
* <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>
*
* @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;