aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-11-21 17:06:12 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-11-21 17:06:12 +0100
commit40ee9b6a03db602b2ca3eddb7a600d38d890c167 (patch)
tree04038ba957148df1956d66ee440bc63304af25c9 /src/main/java/eu
parent888475d4fef98503c16e89b8796c9b18440ceb30 (diff)
parent44faec7051c9fced6bdf7aee5a1f67a05969fc52 (diff)
Merge pull request #705 from betheg/muc
STATUS_CODE_SELF_PRESENCE is not set in all case.
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/MucOptions.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/MucOptions.java b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
index df3c39a9d..c82593277 100644
--- a/src/main/java/eu/siacs/conversations/entities/MucOptions.java
+++ b/src/main/java/eu/siacs/conversations/entities/MucOptions.java
@@ -28,6 +28,7 @@ public class MucOptions {
public static final String STATUS_CODE_BANNED = "301";
public static final String STATUS_CODE_CHANGED_NICK = "303";
public static final String STATUS_CODE_KICKED = "307";
+ public static final String STATUS_CODE_LOST_MEMBERSHIP = "321";
private interface OnEventListener {
public void onSuccess();
@@ -210,18 +211,23 @@ public class MucOptions {
}
}
}
- } else if (type.equals("unavailable") && codes.contains(STATUS_CODE_SELF_PRESENCE)) {
- if (codes.contains(STATUS_CODE_CHANGED_NICK)) {
- this.mNickChangingInProgress = true;
- } else if (codes.contains(STATUS_CODE_KICKED)) {
- setError(KICKED_FROM_ROOM);
- } else if (codes.contains(STATUS_CODE_BANNED)) {
- setError(ERROR_BANNED);
+ } 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)) {
+ this.mNickChangingInProgress = true;
+ } else if (codes.contains(STATUS_CODE_KICKED)) {
+ setError(KICKED_FROM_ROOM);
+ } else if (codes.contains(STATUS_CODE_BANNED)) {
+ setError(ERROR_BANNED);
+ } else if (codes.contains(STATUS_CODE_LOST_MEMBERSHIP)) {
+ setError(ERROR_MEMBERS_ONLY);
+ } else {
+ setError(ERROR_UNKNOWN);
+ }
} else {
- setError(ERROR_UNKNOWN);
+ deleteUser(name);
}
- } else if (type.equals("unavailable")) {
- deleteUser(name);
} else if (type.equals("error")) {
Element error = packet.findChild("error");
if (error != null && error.hasChild("conflict")) {