aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/pixart/messenger/parser
diff options
context:
space:
mode:
authorChristian Schneppe <christian@pix-art.de>2017-03-09 19:40:09 +0100
committerChristian Schneppe <christian@pix-art.de>2017-03-09 19:40:09 +0100
commit76d0fdcc5af795b02eb871f31f323436c7e19cdc (patch)
treefe66970fa646c1dd946be38b58d25fdc0306eb74 /src/main/java/de/pixart/messenger/parser
parentc8b893780f9f7c931eb4ff1b4fbff2d840fcad27 (diff)
fixed multi-session-nick renaming behaviour
Diffstat (limited to 'src/main/java/de/pixart/messenger/parser')
-rw-r--r--src/main/java/de/pixart/messenger/parser/PresenceParser.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/main/java/de/pixart/messenger/parser/PresenceParser.java b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
index 9ba45b201..41dfa61e9 100644
--- a/src/main/java/de/pixart/messenger/parser/PresenceParser.java
+++ b/src/main/java/de/pixart/messenger/parser/PresenceParser.java
@@ -64,18 +64,15 @@ public class PresenceParser extends AbstractParser implements
if (item != null && !from.isBareJid()) {
mucOptions.setError(MucOptions.Error.NONE);
MucOptions.User user = parseItem(conversation, item, from);
- if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE) || packet.getFrom().equals(mucOptions.getConversation().getJid())) {
+ if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE)) {
mucOptions.setOnline();
mucOptions.setSelf(user);
- if (mucOptions.mNickChangingInProgress) {
- if (mucOptions.onRenameListener != null) {
- mucOptions.onRenameListener.onSuccess();
- }
- mucOptions.mNickChangingInProgress = false;
+ if (mucOptions.onRenameListener != null) {
+ mucOptions.onRenameListener.onSuccess();
+ mucOptions.onRenameListener = null;
}
- } else {
- mucOptions.updateUser(user);
}
+ mucOptions.updateUser(user);
if (codes.contains(MucOptions.STATUS_CODE_ROOM_CREATED) && mucOptions.autoPushConfiguration()) {
Log.d(Config.LOGTAG, mucOptions.getAccount().getJid().toBareJid()
+ ": room '"
@@ -111,8 +108,7 @@ public class PresenceParser extends AbstractParser implements
} else if (type.equals("unavailable")) {
if (codes.contains(MucOptions.STATUS_CODE_SELF_PRESENCE) ||
packet.getFrom().equals(mucOptions.getConversation().getJid())) {
- if (codes.contains(MucOptions.STATUS_CODE_CHANGED_NICK)) {
- mucOptions.mNickChangingInProgress = true;
+ if (codes.contains(MucOptions.STATUS_CODE_KICKED)) {
} else if (codes.contains(MucOptions.STATUS_CODE_KICKED)) {
mucOptions.setError(MucOptions.Error.KICKED);
} else if (codes.contains(MucOptions.STATUS_CODE_BANNED)) {
@@ -123,7 +119,7 @@ public class PresenceParser extends AbstractParser implements
mucOptions.setError(MucOptions.Error.MEMBERS_ONLY);
} else if (codes.contains(MucOptions.STATUS_CODE_SHUTDOWN)) {
mucOptions.setError(MucOptions.Error.SHUTDOWN);
- } else {
+ } else if (!codes.contains(MucOptions.STATUS_CODE_CHANGED_NICK)) {
mucOptions.setError(MucOptions.Error.UNKNOWN);
Log.d(Config.LOGTAG, "unknown error in conference: " + packet);
}
@@ -142,7 +138,7 @@ public class PresenceParser extends AbstractParser implements
if (error != null && error.hasChild("conflict")) {
if (mucOptions.online()) {
if (mucOptions.onRenameListener != null) {
- mucOptions.onRenameListener.onFailure();
+ mucOptions.onRenameListener = null;
}
} else {
mucOptions.setError(MucOptions.Error.NICK_IN_USE);