Merge pull request #705 from betheg/muc

STATUS_CODE_SELF_PRESENCE is not set in all case.
This commit is contained in:
Daniel Gultsch 2014-11-21 17:06:12 +01:00
commit 40ee9b6a03
1 changed files with 17 additions and 11 deletions

View File

@ -28,6 +28,7 @@ public class MucOptions {
public static final String STATUS_CODE_BANNED = "301"; public static final String STATUS_CODE_BANNED = "301";
public static final String STATUS_CODE_CHANGED_NICK = "303"; public static final String STATUS_CODE_CHANGED_NICK = "303";
public static final String STATUS_CODE_KICKED = "307"; public static final String STATUS_CODE_KICKED = "307";
public static final String STATUS_CODE_LOST_MEMBERSHIP = "321";
private interface OnEventListener { private interface OnEventListener {
public void onSuccess(); public void onSuccess();
@ -210,18 +211,23 @@ public class MucOptions {
} }
} }
} }
} else if (type.equals("unavailable") && codes.contains(STATUS_CODE_SELF_PRESENCE)) { } else if (type.equals("unavailable")) {
if (codes.contains(STATUS_CODE_SELF_PRESENCE) ||
packet.getFrom().equals(this.conversation.getContactJid())) {
if (codes.contains(STATUS_CODE_CHANGED_NICK)) { if (codes.contains(STATUS_CODE_CHANGED_NICK)) {
this.mNickChangingInProgress = true; this.mNickChangingInProgress = true;
} else if (codes.contains(STATUS_CODE_KICKED)) { } else if (codes.contains(STATUS_CODE_KICKED)) {
setError(KICKED_FROM_ROOM); setError(KICKED_FROM_ROOM);
} else if (codes.contains(STATUS_CODE_BANNED)) { } else if (codes.contains(STATUS_CODE_BANNED)) {
setError(ERROR_BANNED); setError(ERROR_BANNED);
} else if (codes.contains(STATUS_CODE_LOST_MEMBERSHIP)) {
setError(ERROR_MEMBERS_ONLY);
} else { } else {
setError(ERROR_UNKNOWN); setError(ERROR_UNKNOWN);
} }
} else if (type.equals("unavailable")) { } else {
deleteUser(name); deleteUser(name);
}
} else if (type.equals("error")) { } else if (type.equals("error")) {
Element error = packet.findChild("error"); Element error = packet.findChild("error");
if (error != null && error.hasChild("conflict")) { if (error != null && error.hasChild("conflict")) {