mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-11-24 23:32:05 +01:00
Make muc.join() mirror muc.leave() and return the self-presence
This commit is contained in:
parent
aefbb28875
commit
b7709f583d
1 changed files with 8 additions and 4 deletions
|
@ -629,6 +629,7 @@ public class MultiUserChat {
|
||||||
* joining the room, the room will decide the amount of history to send.
|
* joining the room, the room will decide the amount of history to send.
|
||||||
*
|
*
|
||||||
* @param nickname the nickname to use.
|
* @param nickname the nickname to use.
|
||||||
|
* @return the leave self-presence as reflected by the MUC.
|
||||||
* @throws NoResponseException if there was no response from the remote entity.
|
* @throws NoResponseException if there was no response from the remote entity.
|
||||||
* @throws XMPPErrorException if an error occurs joining the room. In particular, a
|
* @throws XMPPErrorException if an error occurs joining the room. In particular, a
|
||||||
* 401 error can occur if no password was provided and one is required; or a
|
* 401 error can occur if no password was provided and one is required; or a
|
||||||
|
@ -641,10 +642,11 @@ public class MultiUserChat {
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
||||||
*/
|
*/
|
||||||
public void join(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
|
public Presence join(Resourcepart nickname) throws NoResponseException, XMPPErrorException,
|
||||||
NotConnectedException, InterruptedException, NotAMucServiceException {
|
NotConnectedException, InterruptedException, NotAMucServiceException {
|
||||||
MucEnterConfiguration.Builder builder = getEnterConfigurationBuilder(nickname);
|
MucEnterConfiguration.Builder builder = getEnterConfigurationBuilder(nickname);
|
||||||
join(builder.build());
|
Presence reflectedJoinPresence = join(builder.build());
|
||||||
|
return reflectedJoinPresence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -691,6 +693,7 @@ public class MultiUserChat {
|
||||||
* decide to create a new room or not.
|
* decide to create a new room or not.
|
||||||
*
|
*
|
||||||
* @param mucEnterConfiguration the configuration used to enter the MUC.
|
* @param mucEnterConfiguration the configuration used to enter the MUC.
|
||||||
|
* @return the join self-presence as reflected by the MUC.
|
||||||
* @throws XMPPErrorException if an error occurs joining the room. In particular, a
|
* @throws XMPPErrorException if an error occurs joining the room. In particular, a
|
||||||
* 401 error can occur if no password was provided and one is required; or a
|
* 401 error can occur if no password was provided and one is required; or a
|
||||||
* 403 error can occur if the user is banned; or a
|
* 403 error can occur if the user is banned; or a
|
||||||
|
@ -702,7 +705,7 @@ public class MultiUserChat {
|
||||||
* @throws InterruptedException if the calling thread was interrupted.
|
* @throws InterruptedException if the calling thread was interrupted.
|
||||||
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
* @throws NotAMucServiceException if the entity is not a MUC serivce.
|
||||||
*/
|
*/
|
||||||
public synchronized void join(MucEnterConfiguration mucEnterConfiguration)
|
public synchronized Presence join(MucEnterConfiguration mucEnterConfiguration)
|
||||||
throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException, NotAMucServiceException {
|
throws XMPPErrorException, NoResponseException, NotConnectedException, InterruptedException, NotAMucServiceException {
|
||||||
// If we've already joined the room, leave it before joining under a new
|
// If we've already joined the room, leave it before joining under a new
|
||||||
// nickname.
|
// nickname.
|
||||||
|
@ -714,7 +717,8 @@ public class MultiUserChat {
|
||||||
LOGGER.log(Level.WARNING, "Could not leave MUC prior joining, assuming we are not joined", e);
|
LOGGER.log(Level.WARNING, "Could not leave MUC prior joining, assuming we are not joined", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
enter(mucEnterConfiguration);
|
Presence reflectedJoinPresence = enter(mucEnterConfiguration);
|
||||||
|
return reflectedJoinPresence;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue