mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +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.
|
||||
* <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;
|
||||
|
|
Loading…
Reference in a new issue