mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +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:
parent
85fcb55bd9
commit
187fe37cd7
1 changed files with 4 additions and 3 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue