diff options
author | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-03-19 15:05:01 +0100 |
---|---|---|
committer | Daniel Gultsch <daniel.gultsch@rwth-aachen.de> | 2014-03-19 15:05:01 +0100 |
commit | 389d4db311f22ceb787976a6c6130bb0260610bb (patch) | |
tree | 47d75d3086256806430ffabd5be3e2181d634779 /src/eu/siacs/conversations/entities | |
parent | 3a98a695d4c77cf879a76262b2d370d79e8b4fdb (diff) |
rename in muc fixed
Diffstat (limited to 'src/eu/siacs/conversations/entities')
-rw-r--r-- | src/eu/siacs/conversations/entities/MucOptions.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/eu/siacs/conversations/entities/MucOptions.java b/src/eu/siacs/conversations/entities/MucOptions.java index 16d9c6a8..4ed83a5a 100644 --- a/src/eu/siacs/conversations/entities/MucOptions.java +++ b/src/eu/siacs/conversations/entities/MucOptions.java @@ -76,6 +76,7 @@ public class MucOptions { private boolean isOnline = false; private int error = 0; private OnRenameListener renameListener = null; + private boolean aboutToRename = false; private User self = new User(); private String subject = null; @@ -121,6 +122,7 @@ public class MucOptions { Element item = packet.findChild("x").findChild("item"); String nick = item.getAttribute("nick"); if (nick!=null) { + aboutToRename = false; if (renameListener!=null) { renameListener.onRename(true); } @@ -131,7 +133,14 @@ public class MucOptions { } else if (type.equals("error")) { Element error = packet.findChild("error"); if (error.hasChild("conflict")) { - this.error = ERROR_NICK_IN_USE; + if (aboutToRename) { + if (renameListener!=null) { + renameListener.onRename(false); + } + aboutToRename = false; + } else { + this.error = ERROR_NICK_IN_USE; + } } } } @@ -195,4 +204,8 @@ public class MucOptions { public String getSubject() { return this.subject; } + + public void flagAboutToRename() { + this.aboutToRename = true; + } }
\ No newline at end of file |