mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 20:12:07 +01:00
Improved Javadocs and error handling code on join method.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@2083 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
ba6521df0d
commit
3564612171
1 changed files with 5 additions and 4 deletions
|
@ -153,10 +153,12 @@ public class GroupChat {
|
||||||
* another nickname, will leave as that name first before joining under the new
|
* another nickname, will leave as that name first before joining under the new
|
||||||
* name.
|
* name.
|
||||||
*
|
*
|
||||||
* @param nickname the nicknam to use.
|
* @param nickname the nickname to use.
|
||||||
* @param timeout the number of milleseconds to wait for a reply from the
|
* @param timeout the number of milleseconds to wait for a reply from the
|
||||||
* group chat that joining the room succeeded.
|
* group chat that joining the room succeeded.
|
||||||
* @throws XMPPException if an error occurs joining the room.
|
* @throws XMPPException if an error occurs joining the room. In particular, a
|
||||||
|
* 409 error can occur if someone is already in the group chat with the same
|
||||||
|
* nickname.
|
||||||
*/
|
*/
|
||||||
public synchronized void join(String nickname, long timeout) throws XMPPException {
|
public synchronized void join(String nickname, long timeout) throws XMPPException {
|
||||||
if (nickname == null || nickname.equals("")) {
|
if (nickname == null || nickname.equals("")) {
|
||||||
|
@ -184,8 +186,7 @@ public class GroupChat {
|
||||||
throw new XMPPException("No response from server.");
|
throw new XMPPException("No response from server.");
|
||||||
}
|
}
|
||||||
else if (presence.getError() != null) {
|
else if (presence.getError() != null) {
|
||||||
throw new XMPPException(presence.getError().getMessage());
|
throw new XMPPException(presence.getError());
|
||||||
|
|
||||||
}
|
}
|
||||||
this.nickname = nickname;
|
this.nickname = nickname;
|
||||||
joined = true;
|
joined = true;
|
||||||
|
|
Loading…
Reference in a new issue